[Beginner] [Rainbow] Wrong Solution but working in terminal

Link to the question : https://www.codechef.com/problems/RAINBOWA
Can anyone tell me why my code is being accepted.
Here’s my code in C :

    #include<stdio.h>

    int main()
    {
      int t, ele, y=0, i, quo, rem, k;
      //printf("Enter number of times to run loops: ");
      scanf("%d",&t);
      int counter[t];
      while(y<t)
      {
          //printf("Enter the number of elements: ");
          scanf("%d",&ele);
          int a[ele];
          counter[y] = 0;

          for(i=0;i<ele;i++)
          {
            scanf("%d",&a[i]);
          }

          quo = ele / 2;
          rem = ele % 2;
          k = quo + rem;

          for(i=0;i<k-1;i++)
          {
            if (a[i] != a[i+1] && a[i] + 1 != a[i+1])
            {
              counter[y]++;
              break;
            }
            
            if(a[i] != a[ele-1-i])
            {
              counter[y]++;
              break;
            }

          }
          y++;
      }
      for(i=0;i<t;i++)
      {
          if(counter[i] == 0){
            printf("yes\n");
          }
          else{
            printf("No\n");
          }
      }
      return 0;
    }

Tiny mistake: you’re printing “No” instead of “no”.

One more mistake, you should verify that a[0] is 1 and a[k]is 7, because each number must appear non-zero number of times.

Thank you. It worked.

//