#include<bits/stdc++.h>
#include<list>
#include<algorithm>
#define ll long long int
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define rep(a,b,c) for(a=b;a<c;a++)
#define repj(a,b,c) for(a=b;a<c;a++)
#define repr for(i=n-1;i>=0;i--)
#define pii pair<ll,ll>
#define pll pair<ll, ll>
#define inf 100000001
const double pie  =3.141592653589793238463;
#define mod 1000000007
#define lb lower_bound
#define up upper_bound
#define rep1 for(i=1;i<=n;i++)
#define vr vector
#define ef else if
#define all(x) (x).begin(), (x).end()
#define SORT(A) sort(A.begin(), A.end());
#define REVERSE(A) reverse(A.begin(), A.end());
#define lenth length()
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll myXOR(unsigned long long int x, unsigned long long int y)
{
    return (x|y)&(~x|~y);
}
ll powerLL(ll x, ll n)
{
    ll result = 1;
    while (n) {
        if (n & 1)
            result = result * x % mod;
        n = n / 2;
        x = x * x % mod;
    }
    return result;
}
int main()
{
     //fastio
    ll t,n,m,i,j,k,l,x,y,z,a,b,c,d,e,p,nl,np,q,r;
    string s1,s2,s3,s4;
    ll sum1=0,sum2=0;
    ll s;
    cin>>n>>t>>s;
    if((n-1)*t<s || t>s)
    {
        cout<<"NO"<<endl;
    }
    else
    {
         cout<<"YES"<<endl;
         x=s/(n-1);
         // cout<<x<<endl;
         while((s-(n-1)*x)<(t-x) && x>0)
         {

              x--;
              // cout<<s-(n-1)*x<<endl;
         }
         y=x;
         t=t-x;
         ll f=1;
         ll ans=1;
         while(y-- && y>=0)
         {
              if(f==1)
              {
                  ans=ans+(n-1);
                  cout<<ans<<" ";
                  s-=(n-1);
                  f*=-1;
              }
              else
              {
                ans=ans-(n-1);
                cout<<ans<<" ";
                s-=(n-1);
                f*=-1;
              }
         }

        if(ans==n)
        {
                f=1;
                while(t-- && t>0  && s>0 && ans>0)
                {

                   if(f==1)
                   {
                         ans--;
                         s--;
                         cout<<ans<<" ";
                         f*=-1;
                   }
                   else
                   {
                         ans++;
                         s--;
                         cout<<ans<<" ";
                         f*=-1;
                   }

                }

        }
        else if(ans==1)
        {
            f=1;
             while(t-- && t>0 && s>0 && ans>0)
            {
               if(f==1)
                   {
                         ans++;
                         s--;
                         cout<<ans<<" ";
                         f*=-1;
                   }
                   else
                   {
                         ans--;
                         s--;
                         cout<<ans<<" ";
                         f*=-1;
                   }
            }

        }
      if(s>0)
      {
        if(ans+s<=n)
        {
            cout<<ans+s<<" ";
        }
        else
        {
            cout<<ans-s<<" ";
        }
      }

    }
}


#include<bits/stdc++.h>
#include<list>
#include<algorithm>
#define ll long long int
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define rep(a,b,c) for(a=b;a<c;a++)
#define repj(a,b,c) for(a=b;a<c;a++)
#define repr for(i=n-1;i>=0;i--)
#define pii pair<ll,ll>
#define pll pair<ll, ll>
#define inf 100000001
const double pie  =3.141592653589793238463;
#define mod 1000000007
#define modp 998244353
#define lb lower_bound
#define up upper_bound
#define rep1 for(i=1;i<=n;i++)
#define vr vector
#define ef else if
#define all(x) (x).begin(), (x).end()
#define SORT(A) sort(A.begin(), A.end());
#define REVERSE(A) reverse(A.begin(), A.end());
#define lenth length()
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll myXOR(unsigned long long int x, unsigned long long int y)
{
    return (x|y)&(~x|~y);
}
ll powerLL(ll x, ll n)
{
    ll result = 1;
    while (n) {
        if (n & 1)
            result = result * x % mod;
        n = n / 2;
        x = x * x % mod;
    }

    return result;
}
ll n, k, s, pos=1;
ll mindist, maxdist;

int main()
{
    cin>>n>>k>>s;
    mindist=k;
    maxdist=(n-1)*k;
    if(s<mindist || s>maxdist)
    {
        cout<<"NO";
        return 0;
    }

    cout<<"YES"<<endl;
    for(int i=k-1;i>=0;i--)
    {
        int minleave=i;
        int cur=min(s-minleave, n-1);
        s-=cur;
        if(pos+cur<=n)
        {
            pos+=cur;
            cout<<pos<<" ";
        }
        else
        {
            pos-=cur;
            cout<<pos<<" ";
        }
    }
    return 0;
}


#include<bits/stdc++.h>
#include<list>
#include<algorithm>
#define ll long long int
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define rep(a,b,c) for(a=b;a<c;a++)
#define repj(a,b,c) for(a=b;a<c;a++)
#define repr for(i=n-1;i>=0;i--)
#define pii pair<ll,ll>
#define pll pair<ll, ll>
#define inf 100000001
const double pie  =3.141592653589793238463;
#define mod 1000000007
#define lb lower_bound
#define up upper_bound
#define rep1 for(i=1;i<=n;i++)
#define vr vector
#define ef else if
#define all(x) (x).begin(), (x).end()
#define SORT(A) sort(A.begin(), A.end());
#define REVERSE(A) reverse(A.begin(), A.end());
#define lenth length()
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll myXOR(unsigned long long int x, unsigned long long int y)
{
    return (x|y)&(~x|~y);
}
ll powerLL(ll x, ll n)
{
    ll result = 1;
    while (n) {
        if (n & 1)
            result = result * x % mod;
        n = n / 2;
        x = x * x % mod;
    }
    return result;
}
int main()
{
     //fastio
    ll t,n,m,i,j,k,l,x,y,z,a,b,c,d,e,p,nl,np,q,r;
    string s1,s2,s3,s4;
    ll sum1=0,sum2=0;
    ll s;
    cin>>n>>t>>s;
    if((n-1)*t<s)
    {
        cout<<"NO"<<endl;
    }
    else
    {
        cout<<"YES"<<endl;
        x=s/(n-1);
        while((s-((n-1)*x))<t-x)
        {
            x--;
        }
        ll ans=1;
        ll f=1;
        t=t-x;
        y=x;
        while(y--)
        {
            if(f==1)
            {
                ans=ans+(n-1);
                cout<<ans<<" ";
                f*=-1;
            }
            else
            {
               ans=ans-(n-1);
               cout<<ans<<" ";
               f*=-1;
            }

        }
        s=s-(n-1)*x;
        t--;
        if(t<=0){
            t=0;
            return 0;

        }
        // cout<<t<<endl;
        // return 0;
        while(t--)
        {
            if(ans+1<=n && f==1)
            {
                ans++;
                f*=-1;
                cout<<ans<<" ";

            }
            else if((ans-1)>=1 && f==-1)
            {
                ans--;
                f*=-1;
                cout<<ans<<" ";
            }
            s--;
        }
        if(ans+s<=n)
        {
            cout<<ans+s<<" ";
        }
        else
        {
            cout<<ans-s<<endl;
        }
    }
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
  int n, k, s;
  cin >> n >> k >> s;
  string res = "";
  int prev = 1;
  if ((n - 1) * k < s || k > s) {
    cout << "NO" << endl;
    return 0;
  }
  int avg = s / k;
  int e = s % k;
  cout << "YES" << endl;
  while (k > 0 && s > 0) {
    if (s >= avg + 1 && e > 0) {
      s = s - avg - 1;
      if (prev == 1) {
        prev = 1 + avg + 1;
      } else {
        prev = 1;
      }
      res += to_string(prev) + " ";
      k--;
      e--;
    } else if (s >= avg) {
      s -= avg;
      if (prev == 1) {
        prev += avg;
      } else {
        prev -= avg;
      }
      res += to_string(prev) + " ";
      k--;
    } else {
      if (e > 0) {
        s += e;
      }
      if (prev == 1) {
        prev += s;
      } else {
        prev -= s;
      }
      s = 0;
      res += to_string(prev) + " ";
      k--;
    }
  }
  cout << res << endl;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll n, k, s;
  cin >> n >> k >> s;
  if ((n - 1) * k < s || k > s) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  ll prev = 1;
  ll avg = s / k;
  ll e = s % k;
  for (ll i = 0; i < k; i++) {
    if (i < e) {
      if (prev == 1) {
        prev += avg + 1;
      } else {
        prev -= avg + 1;
      }
    } else {
      if (prev == 1) {
        prev += avg;
      } else {
        prev -= avg;
      }
    }
    cout << prev << " ";
  }
  return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
  ll n, k, s;
  cin >> n >> k >> s;
  string res = "";
  ll prev = 1;
  if ((n - 1) * k < s || k > s) {
    cout << "NO" << endl;
    return 0;
  }
  ll avg = s / k;
  ll e = s % k;
  cout << "YES" << endl;
  while (k > 0 && s > 0) {
    if (s >= avg + 1 && e > 0) {
      s = s - avg - 1;
      if (prev == 1) {
        prev = 1 + avg + 1;
      } else {
        prev = 1;
      }
      res += to_string(prev) + " ";
      k--;
      e--;
    } else if (s >= avg) {
      s -= avg;
      if (prev == 1) {
        prev += avg;
      } else {
        prev -= avg;
      }
      res += to_string(prev) + " ";
      k--;
    } else {
      if (e > 0) {
        s += e;
      }
      if (prev == 1) {
        prev += s;
      } else {
        prev -= s;
      }
      s = 0;
      res += to_string(prev) + " ";
      k--;
    }
  }
  cout << res << endl;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
  int n, k, s;
  cin >> n >> k >> s;
  string res = "";
  int prev = 1;
  if ((n - 1) * k < s || k > s) {
    cout << "NO" << endl;
    return 0;
  }
  int avg = s / k;
  int e = s % k;
  cout << "YES" << endl;
  while (k > 0 && s > 0) {
    if (s >= avg + 1 && e > 0) {
      s -= avg + 1;
      if (prev == 1) {
        prev = 1 + avg + 1;
      } else {
        prev = 1;
      }
      res += to_string(prev) + " ";
      k--;
      e--;
    } else if (s >= avg) {
      s -= avg;
      if (prev == 1) {
        prev += avg;
      } else {
        prev -= avg;
      }
      res += to_string(prev) + " ";
      k--;
    } else {
    }
  }
  cout << res << endl;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
  int n, k, s;
  cin >> n >> k >> s;
  string res = "";
  int prev = 1;
  if ((n - 1) * k < s || k > s) {
    cout << "NO" << endl;
    return 0;
  }
  int avg = s / k;
  int e = s % k;
  cout << "YES" << endl;
  while (k > 0 && s > 0) {
    if (s >= avg + 1 && e > 0) {
      s = s - avg + 1;
      if (prev == 1) {
        prev = 1 + avg + 1;
      } else {
        prev = 1;
      }
      res += to_string(prev) + " ";
      k--;
      e--;
    } else if (s >= avg) {
      s -= avg;
      if (prev == 1) {
        prev += avg;
      } else {
        prev -= avg;
      }
      res += to_string(prev) + " ";
      k--;
    } else {
      if (e > 0) {
        s += e;
      }
      if (prev == 1) {
        prev += s;
      } else {
        prev -= s;
      }
      s = 0;
      res += to_string(prev) + " ";
      k--;
    }
  }
  cout << res << endl;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
  int n, k, s;
  cin >> n >> k >> s;
  string res = "";
  int prev = 1;
  if ((n - 1) * k < s || k > s) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  int avg = s / k;
  while (k > 2 && s > 0) {
    if (s >= avg) {
      s -= avg;
      if (prev == 1) {
        prev = 1 + avg;
      } else {
        prev = 1;
      }
      res += to_string(prev) + " ";
      k--;
    }
  }
  avg = s / k;
  int a, b;
  while (s > avg && prev + avg < n) {
    avg++;
  }
  a = avg;
  b = avg;
  while (prev - b >= 1 && s > b) {
    b--;
  }
  avg = max(a, b);
  if (prev + avg <= n) {
    prev += avg;
    res += to_string(prev) + " ";
    s -= avg;
  } else {
    prev -= avg;
    res += to_string(prev) + " ";
    s -= avg;
  }
  if (prev + s <= n) {
    prev += s;
    res += to_string(prev) + " ";
  } else {
    prev -= s;
    res += to_string(prev) + " ";
  }
  cout << res << endl;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
  ll n, k, s;
  cin >> n >> k >> s;
  string res = "";
  ll prev = 1;
  if ((n - 1) * k < s || k > s) {
    cout << "NO" << endl;
    return 0;
  }
  ll avg = s / k;
  ll e = s % k;
  cout << "YES" << endl;
  for (int i = 0; i < k; i++) {
    if (i < e) {
      if (prev == 1) {
        prev = 1 + avg + 1;
      } else {
        prev = 1;
      }
      cout << prev << " ";
    } else {
      if (prev == 1) {
        prev += avg;
      } else {
        prev -= avg;
      }
      cout << prev << " ";
    }
  }
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll n, k, s;
  cin >> n >> k >> s;
  if ((n - 1) * k < s || k > s) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  ll prev = 1;
  ll avg = s / k;
  ll e = s % k;
  for (ll i = 0; i < k; i++) {
    if (i < e) {
      if (i % 2 == 0) {
        prev = prev + avg + 1;
      } else {
        prev = prev - (avg + 1);
      }
    } else {
      if (i % 2 == 0) {
        prev += avg;
      } else {
        prev -= avg;
      }
    }
    cout << prev << " ";
  }
  return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define in insert
#define sz(x) ((in)(x).size())
using namespace std;
const int N = 1e5 + 123;

void read_file()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
}

void solve()
{
    int n;
    ll sum = 0;
    ll x;
    cin >> n;
    int z = 0;
    while(n--){
        cin >> x;
        if (!x) z++;
        sum += x;
    }
    if (x & 1 && !z){
        cout << "First\n";
    }else{
        cout << "Second\n";
    }
}

int main()
{
    solve();
    //cerr << printf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
    return (0);
}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define in insert
#define sz(x) ((in)(x).size())
using namespace std;
const int N = 1e6 + 1;
int a[N];

void read_file()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
}

void solve()
{
    int n;
    ll sum = 0;
    ll x;
    cin >> n;
    int b = 0;
    for (int i = 0; i < n; i++){
        cin >> a[i];
        sum += a[i];
        //if (a[i] % 2 != 0) b = i;
    }
    if (sum & 1){
        cout << "First\n";
    }else{
        for (int i = 0; i < n; i++){
            if (a[i] % 2 == 1){
                puts("First");
                return;
            }
        }
        puts("Second");
    }
}

int main()
{
    solve();
    //cerr << printf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
    return (0);
}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define in insert
#define sz(x) ((in)(x).size())
using namespace std;
const int N = 1e5 + 123;
int a[N];

void read_file()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
}

void solve()
{
    int n;
    ll sum = 0;
    ll x;
    cin >> n;
    int b = 0;
    for (int i = 0; i < n; i++){
        cin >> a[i];
        sum += a[i];
        //if (a[i] % 2 != 0) b = i;
    }
    if (sum & 1){
        cout << "First\n";
    }else{
        for (int i = 0; i < n; i++){
            if (a[i] % 2 == 1){
                puts("First");
                return;
            }
        }
        puts("Second");
    }
}

int main()
{
    solve();
    //cerr << printf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
    return (0);
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,a,odd=0,even=0;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        if(a % 2 == 0){
            even += 1;
        }else{
            odd += 1;
        }
    }
    if(odd == 0){
        cout << "Second";
        return 0;
    }else if(even == 0){
        cout << "First";
        return 0;
    }else if(odd % 2 == 1){
        cout << "First";
    }else if(odd % 2 == 0){
        cout << "Second";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,a,sum=0;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        sum += a;
        sum = sum%10;
    }
    if(sum % 2 == 1){
        cout << "First";
    }else{
        cout << "Second";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,a,sum=0;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        sum += a;
    }
    if(sum % 2 == 1){
        cout << "First";
    }else{
        cout << "Second";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,a,sum=0;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        sum += a;
        sum = sum%10;
    }
    if(sum % 2 == 1){
        cout << "First";
    }else{
        cout << "Second";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,a,sum=0;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        sum += a;
    }
    if(sum % 2 == 1){
        cout << "First";
    }else{
        cout << "Second";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,a,odd=0,even=0;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        if(a % 2 == 0){
            even += 1;
        }else{
            odd += 1;
        }
    }
    if(odd == 0){
        cout << "Second";
        return 0;
    }
    if(even == 0){
        cout << "First";
        return 0;
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,a,sum=1,odd=0,even=0;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        if(a % 2 == 0){
            even += 1;
        }else{
            odd += 1;
        }
    }
    if(odd % 2 == 0){
        cout << "Second";
    }else{
        cout << "First";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long n,a,sum=1;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        if(a % 2 == 1){
            sum = 0;
        }
    }
    if(sum == 1){
        cout << "Second";
    }else{
        cout << "First";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,a,odd=0,even=0;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        if(a % 2 == 0){
            even += 1;
        }else{
            odd += 1;
        }
    }
    if(odd == 0){
        cout << "Second";
        return 0;
    }
    if(odd % 2 == 0){
        cout << "Second";
    }else{
        cout << "First";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,a,sum=1;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        if(a % 2 == 1){
            sum = 0;
        }
    }
    if(sum == 1){
        cout << "Second";
    }else{
        cout << "First";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,a,sum=1;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        if(a % 2 == 0){
            sum = 0;
        }
    }
    if(sum == 0){
        cout << "Second";
    }else{
        cout << "First";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,a,sum=1;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        if(a % 2){
            sum = 0;
        }
    }
    if(sum){
        cout << "Second";
    }else{
        cout << "First";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,a,sum=1;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        if(a % 2 == 0){
            sum = 0;
        }
    }
    if(sum == 1){
        cout << "Second";
    }else{
        cout << "First";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,a,sum=1,odd=0,even=0;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        if(a % 2 == 0){
            even += 1;
        }else{
            odd += 1;
        }
    }
    if(odd % 2 == 0){
        cout << "First";
    }else{
        cout << "Second";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long n,a,sum=0;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        sum += a;
        sum = sum%10;
    }
    if(sum % 2 == 1){
        cout << "First";
    }else{
        cout << "Second";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,a,sum=0;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        sum += a;
    }
    if(sum % 2 == 0){
        cout << "Second";
    }else{
        cout << "First";
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,a,sum=1;
    cin >> n;
    for(int i = 0 ; i < n ; i += 1){
        cin >> a;
        if(a % 2 == 0){
            sum = 0;
        }
    }
    if(sum == 0){
        cout << "First";
    }else{
        cout << "Second";
    }
}


#include<bits/stdc++.h>
#define io          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll          int long long
#define pb          push_back
#define endl        '\n'
#define pii         pair<ll ,ll >
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define hell        1000000007
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
using namespace std;

int main()
{
	ll n;
	cin>>n;

	ll a[n];
	ll odd=0;
	rep(i,0,n){
        cin>>a[i];
        if(a[i]%2==1){
            odd++;break;}
	}

	if(odd>0)
        cout<<"First";
    else
        cout<<"Second";

	return 0;
}


#include<bits/stdc++.h>
#define io          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll          int long long
#define pb          push_back
#define endl        '\n'
#define pii         pair<ll ,ll >
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define hell        1000000007
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
using namespace std;

int main()
{
	ll n;
	cin>>n;

	ll a[n];
	ll odd=0,even=0;
	rep(i,0,n){
        cin>>a[i];
        if(a[i]%2==0)
            odd++;
	}

	if(odd>0)
        cout<<"First";
    else
        cout<<"Second";

	return 0;
}


#include<bits/stdc++.h>
#define io          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll          int long long
#define pb          push_back
#define endl        '\n'
#define pii         pair<ll ,ll >
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define hell        1000000007
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
using namespace std;

int main()
{
	ll n;
	cin>>n;

	ll a[n];
	ll odd=0,even=0;
	rep(i,0,n){
        cin>>a[i];
	}

	ll sum[n];
	sum[0]=a[0];
	if(sum[0]%2==0)
        even++;
    else
        odd++;

	rep(i,1,n)
	{
	    sum[i]  = sum[i-1]+a[i];
	    if(sum[i]%2==0)
            even++;
        else
            odd++;
	}
    if(sum[n-1]%2==1)
    {
        cout<<"First";
        return 0;
    }

    if(odd>even)
        cout<<"First";
    else
        cout << "Second";

	return 0;
}


#include<bits/stdc++.h>
#define io          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll          int long long
#define pb          push_back
#define endl        '\n'
#define pii         pair<ll ,ll >
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define hell        1000000007
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
using namespace std;

int main()
{
	ll n;
	cin>>n;

	ll a[n];
	ll sum=0,odd=0,even=0;
	rep(i,0,n){
        cin>>a[i];
        if(a[i]%2==0)
            even++;
        else
            odd++;
        sum+=a[i];
	}

    if(sum%2==1)
    {
        cout<<"First";
        return 0;
    }

    if(odd>even)
        cout<<"First";
    else
        cout << "Second";

	return 0;
}


#include<bits/stdc++.h>
#define io          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll          int long long
#define pb          push_back
#define endl        '\n'
#define pii         pair<ll ,ll >
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define hell        1000000007
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
using namespace std;

int main()
{
	ll n;
	cin>>n;

	ll a[n];
	ll odd=0,even=0;
	rep(i,0,n){
        cin>>a[i];
        if(a[i]%2==1)
            odd++;
	}

	if(odd>0)
        cout<<"First";
    else
        cout<<"Second";

	return 0;
}


#include<bits/stdc++.h>
#define io          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll          int long long
#define pb          push_back
#define endl        '\n'
#define pii         pair<ll ,ll >
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define hell        1000000007
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
using namespace std;

int main()
{
	int n;
	cin>>n;

	int a[n];
	ll sum=0,odd=0,even=0;
	rep(i,0,n){
        cin>>a[i];
        if(a[i]%2==0)
            even++;
        else
            odd++;
        sum+=a[i];
	}

    if(sum%2==1)
    {
        cout<<"First";
        return 0;
    }

    if(odd>even)
        cout<<"First";
    else
        cout << "Second";

	return 0;
}


#include<bits/stdc++.h>
#include <math.h>

#define ll long long int
#define pb push_back
#define fIO ios_base::sync_with_stdio(0);cin.tie(0);

const double pi = 3.1415926535897;

using namespace std;

typedef pair<int,int> ii;

int main(){
    fIO

    int n,even = 0,a;
    cin>>n;

    for(int i=0;i<n;i++){
        cin>>a;
        if(!(a&1)){
            even++;
        }
    }

    if(even == n){
        cout<<"Second";
    }else{
        cout<<"First";
    }

}


#include<bits/stdc++.h>
#include <math.h>

#define ll long long int
#define pb push_back
#define fIO ios_base::sync_with_stdio(0);cin.tie(0);

const double pi = 3.1415926535897;

using namespace std;

typedef pair<int,int> ii;

int main(){
    fIO

    int n,even = 0,a;
    cin>>n;

    for(int i=0;i<n;i++){
        cin>>a;
        if(a&1 == 0){
            even++;
        }
    }

    if(even == n){
        cout<<"Second";
    }else{
        cout<<"First";
    }

}


#include<bits/stdc++.h>
#include <math.h>

#define ll long long int
#define pb push_back

const double pi = 3.1415926535897;

using namespace std;

typedef pair<int,int> ii;

int arr[1000005];

int main(){
    int n,even = 0,odd = 0;
    ll sum = 0;
    cin>>n;

    for(int i=0;i<n;i++){
        cin>>arr[i];
        sum+=arr[i];
        if(arr[i] % 2 == 0){
            even++;
        }else{
            odd++;
        }
    }
    if(sum % 2 != 0){
        cout<<"First";
    }else if(even == n){
        cout<<"Second";
    }else{
        if(arr[0] % 2 == 0 && arr[n-1] % 2 == 0){
            cout<<"Second";
        }else{
            cout<<"First";
        }
    }

}


#include<bits/stdc++.h>
#include <math.h>

#define ll long long int
#define pb push_back

const double pi = 3.1415926535897;

using namespace std;

typedef pair<int,int> ii;

int arr[1000005];

int main(){
    int n,even = 0;
    cin>>n;

    for(int i=0;i<n;i++){
        cin>>arr[i];
        if(arr[i] % 2 == 0){
            even++;
        }
    }

    if(even == n){
        cout<<"Second";
    }else{
        cout<<"First";
    }

}


#include<bits/stdc++.h>
#include <math.h>

#define ll long long int
#define pb push_back

const double pi = 3.1415926535897;

using namespace std;

typedef pair<int,int> ii;

int arr[1000005];

int main(){
    int n,even = 0,odd = 0,sum = 0;
    cin>>n;

    for(int i=0;i<n;i++){
        cin>>arr[i];
        sum+=arr[i];
        if(arr[i] % 2 == 0){
            even++;
        }else{
            odd++;
        }
    }
    if(sum % 2 != 0){
        cout<<"First";
    }else if(even == n){
        cout<<"Second";
    }else{
        if(arr[0] % 2 == 0 && arr[n-1] % 2 == 0){
            cout<<"Second";
        }else{
            cout<<"First";
        }
    }

}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	int fucelement;

	scanf("%d", &n);

	int fucdivisors = 0;
	for(int i = 0; i < n; ++i){
		scanf("%d", &fucelement);

		if(fucelement%2){
			fucdivisors++;
			break;
		}
	}

	if(fucdivisors){
		printf("First\n");
	}
	else{
		printf("Second\n");
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	int fucelement;

	scanf("%d", &n);

	int divisors = 0;
	int fucdivisors = 0;
	for(int i = 0; i < n; ++i){
		scanf("%d", &fucelement);

		if(fucelement%2){
			fucdivisors++;
			break;
		}
		else{
			divisors++;
		}
	}

	if(fucdivisors){
		printf("First\n");
	}
	else{
		printf("Second\n");
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	int z;

	scanf("%d", &n);

	int w = 0;
	for(int i = 0; i < n; ++i){
		scanf("%d", &z);

		if(z%2){
			w++;
			break;
		}
	}

	if(w){
		printf("First\n");
	}
	else{
		printf("Second\n");
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	int skdlfjskdlfjlkdsjf;

	scanf("%d", &n);

	int fucdivisors = 0;
	for(int i = 0; i < n; ++i){
		scanf("%d", &skdlfjskdlfjlkdsjf);

		if(skdlfjskdlfjlkdsjf%2){
			fucdivisors++;
			break;
		}
	}

	if(fucdivisors){
		printf("First\n");
	}
	else{
		printf("Second\n");
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n;
	int z;

	scanf("%d", &n);

	int w = 0;
	while(n){
		scanf("%d", &z);

		if(z%2){
			w++;

		}

		n--;
	}

	if(w){
		printf("First\n");
	}
	else{
		printf("Second\n");
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n;

	scanf("%d", &n);

	int w;
	while(n){
		scanf("%d", &w);

		if(w%2){
			break;
		}

		n--;
	}

	if(w%2){
		printf("First\n");
	}
	else{
		printf("Second\n");
	}

	return 0;
}


#include<iostream>

int main()
{
	std::ios::sync_with_stdio(0);
	std::cin.tie(0);

	int n;

	std::cin >> n;

	int w;
	while(n){
		std::cin >> w;

		if(w%2){
			break;
		}

		n--;
	}

	if(w%2){
		std::cout << "First\n";
	}
	else{
		std::cout << "Second\n";
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	int z;

	scanf("%d", &n);

	int w = 0;
	while(n){
		scanf("%d", &z);

		if(z%2){
			w++;
			break;
		}

		n--;
	}

	if(w){
		printf("First\n");
	}
	else{
		printf("Second\n");
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n;

	cin >> n;

	int w;
	while(n){
		cin >> w;

		if(w%2){
			break;
		}

		n--;
	}

	if(w%2){
		cout << "First\n";
	}
	else{
		cout << "Second\n";
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n;
	int z;

	scanf("%d", &n);

	int w = 0;
	while(n){
		scanf("%d", &z);

		if(z%2){
			w++;
			break;
		}

		n--;
	}

	if(w){
		printf("First\n");
	}
	else{
		printf("Second\n");
	}

	return 0;
}


#include<iostream>

using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n;

	cin >> n;

	int w;
	while(n){
		cin >> w;

		if(w%2){
			break;
		}

		n--;
	}

	if(w%2){
		cout << "First\n";
	}
	else{
		cout << "Second\n";
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,s=0;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		s+=a[i];
	}
	if(s%2==1)
	{
		cout<<"First";

	}
	else
	{
		cout<<"Second";
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ll n,c=0;
	cin>>n;
	ll a[n];
	for(ll i=0;i<n;i+=2)
	{
		cin>>a[i];
		if(a[i]%2==1)
			c++;
	}

	if(c>=1)
	{
		cout<<"First";

	}
	else
	{
		cout<<"Second";
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ll n,s=0;
	cin>>n;
	ll a[n];
	for(ll i=0;i<n;i++)
	{
		cin>>a[i];
		s+=a[i];
	}
	if(s%2==1)
	{
		cout<<"First";

	}
	else
	{
		cout<<"Second";
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ll n,s=0;
	cin>>n;
	ll a[n];
	for(ll i=0;i<n;i++)
	{
		cin>>a[i];
		///s+=a[i];
	}
	sort(a,a+n);
	if(a[0]%2==1)
	{
		cout<<"First";

	}
	else
	{
		cout<<"Second";
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ll n,s=0;
	cin>>n;
	ll a[n];
	for(ll i=0;i<n;i++)
	{
		cin>>a[i];
		///s+=a[i];
	}
	if(a[0]%2==1)
	{
		cout<<"First";

	}
	else
	{
		cout<<"Second";
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ll n,c=0;
	cin>>n;
	ll a[n];
	for(ll i=0;i<n;i++)
	{
		cin>>a[i];
		if(a[i]%2==1){
			c++;
		}
	}
	if(c>=1)
	{
		cout<<"First";

	}
	else
	{
		cout<<"Second";
	}
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;

int main(){
int test;test=1;
while(test--){
int n;cin>>n;
ll sum=0;
for(int i=0;i<n;i++){
        ll x;cin>>x;
    sum=(ll)(sum+x);
}
if(sum&1)cout<<"First"<<endl;
else cout<<"Second"<<endl;
}
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;

int main(){
int test;test=1;
while(test--){
int n;cin>>n;
ll ans=0;

for(int i=0;i<n;i++){
        ll x;cin>>x;
        if(x&1)ans=1;

}

if(n==0){cout<<"Second"<<endl;}

else if(ans==1)cout<<"First"<<endl;

else cout<<"Second"<<endl;
}
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;

int main(){
int test;test=1;
while(test--){
int n;cin>>n;
ll sum=0;

for(int i=0;i<n;i++){
        ll x;cin>>x;
    sum=(ll)(sum+x);
}
if(n==0){cout<<"Second"<<endl;}
else if(sum&1)cout<<"First"<<endl;
else cout<<"Second"<<endl;
}
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;

int main(){
int test;test=1;
while(test--){
int n;cin>>n;
ll sum=0;

for(int i=0;i<n;i++){
        ll x;cin>>x;
    sum=(ll)(sum+x);
}
if(n==0){cout<<"Second"<<endl;return;}
if(sum&1)cout<<"First"<<endl;
else cout<<"Second"<<endl;
}
}


#include<iostream>
using namespace std;
int main()
{
    long long int n,b=0,a;
    cin>>n;
    while(n>0)
    {
        cin>>a;
        n--;
        if((a%2)!=0)
            b++;
    }
    if(b>0)
        cout<<"First";
    else
        cout<<"Second";
}


#include<iostream>
using namespace std;
int main()
{
    long long int n,i,b=0;cin>>n;
    long long int a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        if((a[i]%2)!=0)
            b++;
    }
    if(b>0)
        cout<<"First";
    else
        cout<<"Second";
}


#include<iostream>
using namespace std;
int main()
{
    long int n,i,b=0;cin>>n;
    long int a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        if((a[i]%2)!=0)
            b++;
    }
    if(b>0)
        cout<<"First";
    else
        cout<<"Second";
}


#include<iostream>
using namespace std;
int main()
{
    long int n,a;
    cin>>n;
    while(n>0)
    {
        cin>>a;
        n--;
        if((a%2)!=0){
        cout<<"First";
        return 0;}}
        cout<<"Second";
}


#include<iostream>
using namespace std;
int main()
{
    long int n,i,b=0,a;cin>>n;
    while(n>0)
    {
        cin>>a;
        n--;
        if((a%2)!=0)
            b++;
    }
    if(b>0)
        cout<<"First";
    else
        cout<<"Second";
}


#include<bits/stdc++.h>
#define test int t; cin>>t; while(t--)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
using namespace std;
int main()
{

    int n;
    cin>>n;
    int a[n];
    ll sum=0,o=0,e=0;
    vector<int>v;
    for(int i=0;i<n;i++)
   {
       cin>>a[i];
       sum+=a[i];
       if(a[i]%2)
        o++;
       else
        e++;
   }
   if(sum%2)
    cout<<"First"<<endl;
   else
   {
       if(o%2==0&&e%2)
        cout<<"First"<<endl;
       else if(o==0)
        cout<<"Second"<<endl;
        else if(e==0)
        cout<<"First"<<endl;
         else if(e==o)
         cout<<"First"<<endl;

   }
    return 0;
}


#include<bits/stdc++.h>
#define test int t; cin>>t; while(t--)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
using namespace std;
int main()
{
while(1){
    int n;
    cin>>n;
    int a[n];
    ll sum=0,o=0,e=0;
    vector<int>v;
    for(int i=0;i<n;i++)
   {
       cin>>a[i];
       sum+=a[i];
       if(a[i]%2)
        o++;
       else
        e++;
   }
   if(sum%2)
    cout<<"First"<<endl;
   else
   {
       if(o%2==0&&e%2==0&&o>1)
        cout<<"First"<<endl;
       else if(o==0)
        cout<<"Second"<<endl;
        else if(e==0)
        cout<<"First"<<endl;
         else if(e==o)
         cout<<"First"<<endl;

   }
}

    return 0;
}


#include<bits/stdc++.h>
#define test int t; cin>>t; while(t--)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
using namespace std;
int main()
{

    int n;
    cin>>n;
    int a[n];
    ll sum=0,o=0,e=0;
    vector<int>v;
    for(int i=0;i<n;i++)
   {
       cin>>a[i];
       sum+=a[i];
       if(a[i]%2)
        o++;
       else
        e++;
   }
   if(sum%2)
    cout<<"First"<<endl;
   else
   {
       if(o%2==0&&e%2==0&&o>1)
        cout<<"First"<<endl;
       else if(o==0)
        cout<<"Second"<<endl;
        else if(e==0)
        cout<<"First"<<endl;
         else if(e==o)
         cout<<"First"<<endl;

   }

    return 0;
}


#include<bits/stdc++.h>
#define test int t; cin>>t; while(t--)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
using namespace std;
int main()
{

    int n;
    cin>>n;
    int a[n];
    ll sum=0,o=0,e=0;
    vector<int>v;
    for(int i=0;i<n;i++)
   {
       cin>>a[i];
       sum+=a[i];
       if(a[i]%2)
        o++;
       else
        e++;
   }
   if(sum%2)
    cout<<"First"<<endl;
   else
   {
       if(o%2==0&&e%2&&o>1)
        cout<<"First"<<endl;
       else if(o==0)
        cout<<"Second"<<endl;
        else if(e==0)
        cout<<"First"<<endl;
         else if(e==o)
         cout<<"First"<<endl;

   }

    return 0;
}


#include<bits/stdc++.h>
#define test int t; cin>>t; while(t--)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
using namespace std;
int main()
{

    int n;
    cin>>n;
    int a[n];
    ll sum=0;
    vector<int>v;
    for(int i=0;i<n;i++)
   {
       cin>>a[i];
       sum+=a[i];
   }
   if(sum%2)
    cout<<"First"<<endl;
   else
    cout<<"Second"<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define test int t; cin>>t; while(t--)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
using namespace std;
int main()
{
    fast

    int n;
    cin>>n;
    int a[n];
    ll sum=0,o=0,e=0;
    vector<int>v;
    for(int i=0;i<n;i++)
   {
       cin>>a[i];
       sum+=a[i];
       if(a[i]%2)
        o++;
       else
        e++;
   }
   if(sum%2)
    cout<<"First"<<endl;
   else
   {
       if(o%2==0&&e%2==0&&o>1)
        cout<<"First"<<endl;
       else if(o==0)
        cout<<"Second"<<endl;
        else if(e==0)
        cout<<"First"<<endl;
         else if(e==o)
         cout<<"First"<<endl;
           else
            cout<<"First"<<endl;

   }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

void solve(){
    long long n,a,t;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a;t+=a;
    }
    if(t%2==0)cout<<"Second";
    else cout<<"First";
}

int main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(0);cout.tie(0);

    //freopen("","r",stdin);
    //freopen("","w",stdout);

    //cout<<setprecision(20)<<fixed;

    //int t;cin>>t;while(t--)

    solve();

}


#include<bits/stdc++.h>
using namespace std;

void solve(){
    long long n,a,t,le=0,chan=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a;t+=a;
        if(a%2)le++;
    }
    if((t%2&&t!=0)||le>=1){cout<<"First";return ;}
    cout<<"Second";
}

int main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(0);cout.tie(0);

    //freopen("","r",stdin);
    //freopen("","w",stdout);

    //cout<<setprecision(20)<<fixed;

    //int t;cin>>t;while(t--)

    solve();

}


#include<bits/stdc++.h>
using namespace std;

void solve(){
    long long n,a,t=0,le=0,chan=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a;t+=a;
    }
    if(t%2&&t!=0){cout<<"First";return ;}
    cout<<"Second";
}

int main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(0);cout.tie(0);

    //freopen("","r",stdin);
    //freopen("","w",stdout);

    //cout<<setprecision(20)<<fixed;

    //int t;cin>>t;while(t--)

    solve();

}


#include<iostream>
using namespace std;
unsigned long long n,x;
int main()
{
	int odd=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>x;
		if(x%2==0)continue;
		if(++odd>1){
			cout<<"First";
            return 0;}
	}
	cout<<"Second";
}


#include<bits/stdc++.h>
using namespace std;

void solve(){
    long long n,a,t;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a;t+=a;
    }
    if(t%2)cout<<"Second";
    else cout<<"First";
}

int main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(0);cout.tie(0);

    //freopen("","r",stdin);
    //freopen("","w",stdout);

    //cout<<setprecision(20)<<fixed;

    //int t;cin>>t;while(t--)

    solve();

}


#include<iostream>
using namespace std;
unsigned long long n,x;
int main()
{
	int odd=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>x;
		if(x%2==0)continue;
		if(++odd>1)
			cout<<"First";
	}
	cout<<"Second";
}


#include<bits/stdc++.h>
using namespace std;

void solve(){
    long long n,a,t,le=0,chan=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a;t+=a;
    }
    if(t%2&&t!=0){cout<<"First";return ;}
    cout<<"Second";
}

int main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(0);cout.tie(0);

    //freopen("","r",stdin);
    //freopen("","w",stdout);

    //cout<<setprecision(20)<<fixed;

    //int t;cin>>t;while(t--)

    solve();

}


#include <bits/stdc++.h>
using namespace std;
int main() {
	int n,odd=0,even=0,x;
	cin>>n;
	for (int i=0;i<n;i++){
	    cin>>x;
	    odd+=(x%2!=0);
	    even+=(x%2==0);
	}
	if (odd>=even) cout<<"First";
	else cout<<"Second";
	return 0;
}


#include <iostream>
using namespace std;
int arr[1000007];
int main() {
	int n;
	cin>>n;
	for (int i=0;i<n;i++) {
		cin>>arr[i];
	}
	if (arr[0]%2!=0) cout<<"First";
	else cout<<"Second";
}


#include <iostream>
using namespace std;
int arr[1000007];
int main() {
	int n,firs=0;
	cin>>n;
	for (int i=0;i<n;i++) {
		cin>>arr[i];
		if (arr[i]%2!=0) firs=1;
	}
	if (firs==1) cout<<"First";
	else cout<<"Second";
}


#include <bits/stdc++.h>
using namespace std;
int main() {
	int n,odd=0,even=0,x;
	cin>>n;
	for (int i=0;i<n;i++){
	    cin>>x;
	    odd+=(x%2!=0);
	    even+=(x%2==0);
	}
	if (odd>even) cout<<"First";
	else cout<<"Second";
	return 0;
}


#include <iostream>

using namespace std;

int main() {
  int x;
  cin>>x;
  int sum=0;
  int *a=new int[x];
  for(int i=0;i<x;i++){cin>>a[i];sum+=a[i];}
  if(sum%2==0)cout<<"Second";
  else cout<<"First";
    return 0;
}


#include <iostream>

using namespace std;

int main() {
 long long x;
  cin>>x;
long long sum=0int b=0;
  long long *a=new long long[x];
  for(long long i=0;i<x;i++){cin>>a[i];sum+=a[i];if (a[i]%2==1)b=1;}
  if(sum%2==0&&b=0)cout<<"Second";
  else cout<<"First";

    return 0;
}


#include <iostream>

using namespace std;

int main() {
 long long x;
  cin>>x;
long long sum=0,b=0;
  long long *a=new long long[x];
  for(long long i=0;i<x;i++){cin>>a[i];sum+=a[i];if (a[i]%2==1)b=1;}
  if(sum%2==0&&b==0)cout<<"Second";
  else cout<<"First";

    return 0;
}


#include <iostream>

using namespace std;

int main() {
 long long x;
  cin>>x;
long long sum=0;
  long long *a=new long long[x];
  for(long long i=0;i<x;i++){cin>>a[i];sum+=a[i];if (a[i]%2==1)b=1;}
  if(sum%2==0&&b=0)cout<<"Second";
  else cout<<"First";

    return 0;
}


#include <iostream>

using namespace std;

int main() {
 long long x;
  cin>>x;
long long sum=0;
  long long *a=new long long[x];
  for(long long i=0;i<x;i++){cin>>a[i];sum+=a[i];}
  if(sum%2==0)cout<<"Second";
  else cout<<"First";
    return 0;
}


#include <iostream>

using namespace std;

int main() {
  int x;
  cin>>x;
  int sum=0;
  int a=new int[x];
  for(int i=0;i<x;i++){cin>>a[i];sum+=a[i]}
  if(sum%2==0)cout<<"Second";
  else cout<<"First";
    return 0;
}


#include <iostream>

using namespace std;

int main() {
 long long x;
  cin>>x;
long long sum=0,b=0;
  long long *a=new long long[x];
  for(long long i=0;i<x;i++){cin>>a[i];sum+=a[i];if (a[i]%2==1)b=1;}
  if(sum%2==0&&b=0)cout<<"Second";
  else cout<<"First";

    return 0;
}


#include <iostream>

using namespace std;

int main() {
  int x;
  cin>>x;

  int a=new int[x];
  for(int i=0;i<x;i++){cin>>a[i];sum+=a[i]}
  if(sum%2==0)cout<<"Second";
  else cout<<"First";
    return 0;
}


#include <iostream>

using namespace std;

int main()
{long long int i,n,a[1000001],sum=0,flag=0;
cin>>n;
for(i=0;i<n;i++)
{cin>>a[i];
if(a[i]%2==0)
    flag++;
}
if(flag!=n)
cout<<"First";
else
cout<<"Second";

    return 0;
}


#include <iostream>

using namespace std;

int main()
{long long int i,n,a[1000001],sum=0,flag=0;
cin>>n;
for(i=0;i<n;i++)
{cin>>a[i];
if(a[i]%2!=0)
    flag=1;
}
if(flag=1)
cout<<"First";
else
cout<<"Second";

    return 0;
}


#include <iostream>

using namespace std;

int main()
{long long int i,n,a[1000001],sum=0;
cin>>n;
for(i=0;i<n;i++)
{cin>>a[i];
sum=sum+a[i];
}
if(sum%2!=0)
cout<<"First";
else
cout<<"Second";

    return 0;
}


#include <iostream>

using namespace std;

int main()
{int i,n,even=0,odd=0,a[100000];
cin>>n;
for(i=0;i<n;i++)
{cin>>a[i];
{if(a[i]%2==0)
    even++;
else
    odd++;
}
}
if(odd>even)
    cout<<"first";
else
    cout<<"Second";

    return 0;
}


#include <iostream>

using namespace std;

int main()
{int i,n,even=0,odd=0,a[100000];
cin>>n;
for(i=0;i<n;i++)
{cin>>a[i];
{if(a[i]%2==0)
    even++;
else
    odd++;
}
}
if(odd>even)
    cout<<"First";
else
    cout<<"Second";

    return 0;
}


#include <iostream>

using namespace std;

int main()
{int i,n,a[1000001],sum=0;
cin>>n;
for(i=0;i<n;i++)
{cin>>a[i];
sum=sum+a[i];
}
if(sum%2!=0)
cout<<"First";
else
cout<<"Second";

    return 0;
}


#include <iostream>

using namespace std;

int main()
{long long int i,n,a[1000001],sum=0,flag=0;
cin>>n;
for(i=0;i<n;i++)
{cin>>a[i];
if(a[i]%2!=0)
    flag++;
}
if(flag==n)
cout<<"First";
else
cout<<"Second";

    return 0;
}


#include <iostream>

using namespace std;

int main()
{int i,n,even=0,odd=0,a[10000000];
cin>>n;
for(i=0;i<n;i++)
{cin>>a[i];
{if(a[i]%2==0)
    even++;
else
    odd++;
}
}
if(odd>even)
    cout<<"First";
else
    cout<<"Second";

    return 0;
}


#include <iostream>

using namespace std;

int main()
{long long int i,n,a[1000001],sum=0,flag=0;
cin>>n;
for(i=0;i<n;i++)
{cin>>a[i];
if(a[i]%2==0)
    flag++;
}
if(flag==n)
cout<<"First";
else
cout<<"Second";

    return 0;
}


#include<bits/stdc++.h>
#include<string>
#include<cmath>
using namespace std;
int main ()
{
    long long int n,i,sum=0,x;
    cin>>n;
    for(i=0; i<n; i++)
    {
        cin>>x;
        sum+=x;
    }
    if(sum%2==0)
        cout<<"Second";
    else
        cout<<"First";
    return 0;
}


#include<bits/stdc++.h>
#include<string>
#include<cmath>
using namespace std;
int main ()
{
    long long int n,i,sum=0,x;
    cin>>n;
    for(i=0; i<n; i++)
    {
        cin>>x;
        sum+=x;
        sum=(sum%10);
    }
    if(sum%2==1)
        cout<<"Second";
    else
        cout<<"First";
    return 0;
}


#include<bits/stdc++.h>
#include<string>
#include<cmath>
using namespace std;
int main ()
{
    long long int n,i,sum=0,x;
    cin>>n;
    for(i=0; i<n; i++)
    {
        cin>>x;
        sum+=x;
        sum=(sum%10);
    }
    if(sum%2==0)
        cout<<"Second";
    else
        cout<<"First";
    return 0;
}


#include<bits/stdc++.h>
#include<string>
#include<cmath>
using namespace std;
int main ()
{
    long long int n,i,sum=0,x;
    cin>>n;
    for(i=0; i<n; i++)
    {
        cin>>x;
        sum+=x;
        sum=(sum%10);
        cout<<sum<<endl;
    }
    if(sum%2==0)
        cout<<"Second";
    else
        cout<<"First";
    return 0;
}


#include<bits/stdc++.h>
#include<string>
#include<cmath>
using namespace std;
int main ()
{
    long long int n,i,x;
    bool k= false;
    cin>>n;
    for(i=0; i<n; i++)
    {
        cin>>x;
        if(x%2==1)
            k=true;
    }
    if(k==false)
        cout<<"Second";
    else
        cout<<"First";
    return 0;
}


#include <bits/stdc++.h>
#define int long long

using namespace std;

const int N = 1e6 + 1;
int a[N];
int32_t main(){
	ios_base::sync_with_stdio(0);
	int n ;
	cin>>n;
	for (int i = 0; i < n ; ++ i) cin>>a[i];
	int chet = 0, nechet = 0;
	for (int i = 0; i < n ; ++ i)  {
		if (a[i] % 2 == 0) {
			chet++;
		} else nechet++;
	}
	if (chet > nechet ) cout<<"Second"; else cout<<"First";
}


#include <bits/stdc++.h>
#define int long long

using namespace std;

const int N = 1e6 + 1;
int a[N];
int32_t main(){
	ios_base::sync_with_stdio(0);
	int n ;
	cin>>n;
	for (int i = 0; i < n ; ++ i) cin>>a[i];
	int chet = 0, sum = 0;
	for (int i = 0; i < n ; ++ i)  {
		if (a[i] % 2 != 0) chet++;
		sum += a[i];
	}
	if (sum % 2 || chet) {
		cout<<"First";
	} else cout<<"Second";
}


#include <bits/stdc++.h>
using namespace std;

const int N = 1e6 + 1;
int a[N];
int main(){
	int n ;
	cin>>n;
	for (int i = 0; i < n ; ++ i) cin>>a[i];
	int chet = 0, nechet = 0;
	for (int i = 0; i < n ; ++ i)  {
		if (a[i] % 2 == 0) {
			chet++;
		} else nechet++;
	}
	if (chet > nechet ) cout<<"Second"; else cout<<"First";
}


#include <bits/stdc++.h>
using namespace std;

const int N = 1e6 + 1;
int a[N];
int main(){
	int n ;
	cin>>n;
	for (int i = 0; i < n ; ++ i) cin>>a[i];
	int chet = 0, nechet = 0;
	for (int i = 0; i < n ; ++ i)  {
		if (a[i] % 2 == 0) {
			chet++
		} else nechet++;
	}
	if (chet > nechet ) cout<<"Second"; else cout<<"First";
}


#include <stdio.h>

int getIndexBefore(int index, int *arr, int n)
{
    if (!index) return n - 1;
    return index - 1;
}

int getIndexAfter(int index, int *arr, int n)
{
    if (index >= n - 1) return 0;
    return index + 1;
}

int getMinIndex(int *arr, int n)
{
    int result = 0;
    for (int i = 1; i < n; i++)
        if (arr[i] < arr[result]) result = i;
    return result;
}

void solve(int *arr, int n)
{
    int index = getMinIndex(arr, n);
    int (*getNextIndex)(int, int *, int) = (arr[index + 1] > arr[index]) ? getIndexAfter : getIndexBefore;

    for (int i = 0; i < n; i++)
    {
        int nextIndex = getNextIndex(index, arr, n);
        if (arr[nextIndex] - arr[index] != 1)
        {
            printf("NO\n");
            return;
        }
        index = nextIndex;
    }
    printf("YES\n");
}

int main(void)
{
    int test_cases;
    scanf("%d", &test_cases);
    for (int i = 0; i < test_cases; i++)
    {
        int n;
        scanf("%d", &n);
        int arr[n];
        for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
        solve(arr, n);
    }

    return 0;
}


#include <stdio.h>

int getIndexBefore(int index, int *arr, int n)
{
    if (!index) return n - 1;
    return index - 1;
}

int getIndexAfter(int index, int *arr, int n)
{
    if (index >= n - 1) return 0;
    return index + 1;
}

int getMinIndex(int *arr, int n)
{
    int result = 0;
    for (int i = 1; i < n; i++)
        if (arr[i] < arr[result]) result = i;
    return result;
}

int main(void)
{
    int n;
    scanf("%d", &n);
    int arr[n];
    for (int i = 0; i < n; i++) scanf("%d", &arr[i]);

    int index = getMinIndex(arr, n);
    int (*getNextIndex)(int, int *, int) = (arr[index + 1] > arr[index]) ? getIndexAfter : getIndexBefore;

    for (int i = 0; i < n; i++)
    {
        int nextIndex = getNextIndex(index, arr, n);
        if (arr[nextIndex] - arr[index] != 1)
        {
            printf("NO\n");
            return 0;
        }
        index = nextIndex;
    }
    printf("YES\n");
    return 0;
}


#include <stdio.h>

int getIndexBefore(int index, int *arr, int n)
{
    if (!index) return n - 1;
    return index - 1;
}

int getIndexAfter(int index, int *arr, int n)
{
    if (index >= n - 1) return 0;
    return index + 1;
}

int getMinIndex(int *arr, int n)
{
    int result = 0;
    for (int i = 1; i < n; i++)
        if (arr[i] < arr[result]) result = i;
    return result;
}

int main(void)
{
    int n;
    scanf("%d", &n);
    int arr[n];
    for (int i = 0; i < n; i++) scanf("%d", &arr[i]);

    int index = getMinIndex(arr, n);
    int (*getNextIndex)(int, int *, int) = (arr[startingIndex + 1] > arr[startingIndex]) ? getIndexAfter : getIndexBefore;

    for (int i = 0; i < n; i++)
    {
        int nextIndex = getNext(index, arr, n);
        if (arr[nextIndex] - arr[index] != 1)
        {
            printf("NO\n");
            return 0;
        }
        index = nextIndex;
    }
    printf("YES\n");
    return 0;
}


#include <stdio.h>

int getIndexBefore(int index, int *arr, int n)
{
    if (!index) return n - 1;
    return index - 1;
}

int getIndexAfter(int index, int *arr, int n)
{
    if (index >= n - 1) return 0;
    return index + 1;
}

int getMinIndex(int *arr, int n)
{
    int result = 0;
    for (int i = 1; i < n; i++)
        if (arr[i] < arr[result]) result = i;
    return result;
}

void solve(int *arr, int n)
{
    int index = getMinIndex(arr, n);
    int (*getNextIndex)(int, int *, int) = (arr[index + 1] > arr[index]) ? getIndexAfter : getIndexBefore;

    for (int i = 0; i < n - 1; i++)
    {
        int nextIndex = getNextIndex(index, arr, n);
        if (arr[nextIndex] - arr[index] != 1)
        {
            printf("NO\n");
            return;
        }
        index = nextIndex;
    }
    printf("YES\n");
}

int main(void)
{
    int test_cases;
    scanf("%d", &test_cases);
    for (int i = 0; i < test_cases; i++)
    {
        int n;
        scanf("%d", &n);
        int arr[n];
        for (int j = 0; j < n; j++) scanf("%d", &arr[j]);
        solve(arr, n);
    }

    return 0;
}


#include <stdio.h>

int getIndexBefore(int index, int *arr, int n)
{
    if (!index) return n - 1;
    return index - 1;
}

int getIndexAfter(int index, int *arr, int n)
{
    if (index >= n - 1) return 0;
    return index + 1;
}

int getMinIndex(int *arr, int n)
{
    int result = 0;
    for (int i = 1; i < n; i++)
        if (arr[i] < arr[result]) result = i;
    return result;
}

void solve(int arr, int n)
{
    int index = getMinIndex(arr, n);
    int (*getNextIndex)(int, int *, int) = (arr[index + 1] > arr[index]) ? getIndexAfter : getIndexBefore;

    for (int i = 0; i < n; i++)
    {
        int nextIndex = getNextIndex(index, arr, n);
        if (arr[nextIndex] - arr[index] != 1)
        {
            printf("NO\n");
            return;
        }
        index = nextIndex;
    }
    printf("YES\n");
}

int main(void)
{
    int test_cases;
    scanf("%d", &test_cases);
    for (int i = 0; i < test_cases; i++)
    {
        int n;
        scanf("%d", &n);
        int arr[n];
        for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
        solve(arr, n);
    }

    return 0;
}


#include<stdio.h>

int main()
{
    int i,t,n,j,x,ans,l;
    scanf("%d",&t);
    for(i=0;i<t;i++)
    {
        ans=0;
        scanf("%d",&n);
        int arr[n];
        for(j=0;j<n;j++)
        {
            scanf("%d",&arr[j]);
            if(arr[j]==1)
                x=j;
        }
        for(j=(x+1)%n;j!=x;j=(j+1)%n)
        {
            if(j==0)
                l=n-1;
            else
                l=j-1;
            if(arr[j]!=arr[l]+1)
            {
                ans++;
                break;
            }
        }
        if(x==0)
            j=n-1;
        else
            j=x-1;
        for(;j!=x;j--)
        {
            if(arr[j]!=(arr[(j+1)%n]+1))
            {
                ans++;
                break;

            }
            if(j==0)
                j=n;
        }
        if(ans==2)
            printf("NO\n");
        else
            printf("YES\n");
    }
    return 0;
}


#include<stdio.h>

int main()
{
    int i,t,n,j,x,ans,l;
    scanf("%d",&t);
    for(i=0;i<t;i++)
    {
        ans=0;
        scanf("%d",&n);
        int arr[n];
        for(j=0;j<n;j++)
        {
            scanf("%d",&arr[j]);
            if(arr[j]==1)
                x=j;
        }
        for(j=x+1;j!=x;j=(j+1)%n)
        {
            if(j==0)
                l=n-1;
            else
                l=j-1;
            if(arr[j]!=arr[l]+1)
            {
                ans++;
                break;
            }
        }
        if(x==0)
            j=n-1;
        else
            j=x-1;
        for(;j!=x;j--)
        {
            if(arr[j]!=(arr[(j+1)%n]+1))
            {
                ans++;
                break;

            }
            if(j==0)
                j=n;
        }
        if(ans==2)
            printf("NO\n");
        else
            printf("YES\n");
    }
    return 0;
}


#include<stdio.h>

int main()
{
    int i,t,n,j,x,ans;
    scanf("%d",&t);
    for(i=0;i<t;i++)
    {
        ans=0;
        scanf("%d",&n);
        int arr[n];
        for(j=0;j<n;j++)
        {
            scanf("%d",&arr[j]);
            if(arr[j]==1)
                x=j;
        }
        for(j=x+1;j!=x;j=(j+1)%n)
        {
            if(arr[j]!=arr[j-1]+1)
            {
                ans++;
                break;
            }
        }
        if(x==0)
            j=n-1;
        else
            j=x-1;
        for(;j!=x;j--)
        {
            if(arr[j]!=(arr[(j+1)%n]+1))
            {
                ans++;
                break;

            }
            if(j==0)
                j=n;
        }
        if(ans==2)
            printf("NO\n");
        else
            printf("YES\n");
    }
    return 0;
}


#include<stdio.h>

int main()
{
    int q, n;
    int ara[201];
    int i;
    int clockwise;
    scanf("%d", &q);
    while(q--)
    {
        scanf("%d", &n);
        for(i=1; i<=n; i++) scanf("%d", &ara[i]);
        clockwise=0;

        if(ara[2]==ara[1]+1) clockwise = 1;
        else if(ara[2]+1==ara[1]) clockwise = -1;
        else if(ara[1] == 1 && n>2 && ara[2]==n && ara[3]==n-1) clockwise=-1;
        else if(ara[1] == n && n>2 && ara[2]==1 && ara[3]==2) clockwise=1;

        //printf("cw=%d\n", clockwise);

        for(i=2; i<n; i++)
        {
            if(clockwise==1)
            {
                if(ara[i+1]!=1 && ara[i+1]!=ara[i]+1)
                {
                    clockwise=0;
                    break;
                }
            }
            else if(clockwise=-1)
            {
                if(ara[i+1]!=n && ara[i+1]+1!=ara[i])
                {
                    clockwise=0;
                    break;
                }

            }
        }
        if(clockwise==1 || clockwise==-1) printf("YES\n");
        else printf("NO\n");
    }

    return 0;
}


#include<stdio.h>
#include<math.h>
int main()
{
    int q, n;
    int ara[201];
    int i;
    int clockwise;
    scanf("%d", &q);
    while(q--)
    {
        scanf("%d", &n);
        for(i=1; i<=n; i++) scanf("%d", &ara[i]);

        clockwise=0;
        if(n==1 && ara[1]==1) clockwise=1;
        else if(ara[2]==ara[1]+1) clockwise = 1;
        else if(ara[2]+1==ara[1]) clockwise = -1;
        else if(ara[1] == 1 && n>2 && ara[2]==n && ara[3]==n-1) clockwise=-1;
        else if(ara[1] == n && n>2 && ara[2]==1 && ara[3]==2) clockwise=1;
        else if(abs(ara[1]-ara[2])>1)
        {
            printf("NO\n");
            continue;
        }

        printf("cw=%d\n", clockwise);

        for(i=2; i<n; i++)
        {
            if(clockwise==1)
            {
                if((ara[i+1]!=1) && ara[i+1]!=ara[i]+1)
                {
                    clockwise=0;
                    break;
                }
            }
            else if(clockwise=-1)
            {
                if(ara[i+1]!=n && ara[i+1]+1!=ara[i])
                {
                    clockwise=0;
                    break;
                }

            }
        }
        if(clockwise==1 || clockwise==-1) printf("YES\n");
        else printf("NO\n");

        for(i=1; i<=n; i++) ara[i]=0;
    }

    return 0;
}


#include<stdio.h>

int main()
{
    int q, n;
    int ara[201];
    int i;
    int clockwise;
    scanf("%d", &q);
    while(q--)
    {
        scanf("%d", &n);
        for(i=1; i<=n; i++) scanf("%d", &ara[i]);

        clockwise=0;
        if(n==1 && ara[1]==1) clockwise=1;
        else if(ara[2]==ara[1]+1) clockwise = 1;
        else if(ara[2]+1==ara[1]) clockwise = -1;
        else if(ara[1] == 1 && n>2 && ara[2]==n && ara[3]==n-1) clockwise=-1;
        else if(ara[1] == n && n>2 && ara[2]==1 && ara[3]==2) clockwise=1;

        //printf("cw=%d\n", clockwise);

        for(i=2; i<n; i++)
        {
            if(clockwise==1)
            {
                if(ara[i+1]!=1 && ara[i+1]!=ara[i]+1)
                {
                    clockwise=0;
                    break;
                }
            }
            else if(clockwise=-1)
            {
                if(ara[i+1]!=n && ara[i+1]+1!=ara[i])
                {
                    clockwise=0;
                    break;
                }

            }
        }
        if(clockwise==1 || clockwise==-1) printf("YES\n");
        else printf("NO\n");

        for(i=1; i<=n; i++) ara[i]=0;
    }

    return 0;
}


#include<stdio.h>
#include<math.h>
int main()
{
    int q, n;
    int ara[201];
    int i;
    int clockwise;
    scanf("%d", &q);
    while(q--)
    {
        scanf("%d", &n);
        for(i=1; i<=n; i++) scanf("%d", &ara[i]);

        clockwise=0;
        if(n==1 && ara[1]==1) clockwise=1;
        else if(ara[2]==ara[1]+1) clockwise = 1;
        else if(ara[2]+1==ara[1]) clockwise = -1;
        else if(ara[1] == 1 && n>2 && ara[2]==n && ara[3]==n-1) clockwise=-1;
        else if(ara[1] == n && n>2 && ara[2]==1 && ara[3]==2) clockwise=1;
        else if(abs(ara[1]-ara[2])>1)
        {
            printf("NO\n");
            continue;
        }

        //printf("cw=%d\n", clockwise);

        for(i=2; i<n; i++)
        {
            if(clockwise==1)
            {
                if((ara[i+1]!=1) && ara[i+1]!=ara[i]+1)
                {
                    clockwise=0;
                    break;
                }
            }
            else if(clockwise=-1)
            {
                if(ara[i+1]!=n && ara[i+1]+1!=ara[i])
                {
                    clockwise=0;
                    break;
                }

            }
        }
        if(clockwise==1 || clockwise==-1) printf("YES\n");
        else printf("NO\n");

        for(i=1; i<=n; i++) ara[i]=0;
    }

    return 0;
}


#include <stdio.h>
int main()
{
    long long n,q,x,che=0,cle=0,dif,coun,k;
    scanf("%lld",&q);
    for(k=0;k<q;k++)
    {
        scanf("%lld",&n);
        long long arr[n];
        for(x=0;x<n;x++)
        scanf("%lld",&arr[x]);
        che=0;
        cle=0;
        coun=0;
        for(x=0;x<n;x++)
        {
            if(x==n-1)dif=arr[n-1]-arr[0];
            else
            dif=arr[x+1]-arr[x];
            if(dif==n-1)
            {
                coun++;
                if(coun>1)
                {
                cle=1;
                 break;
                }
            }
            else
            {
            if(dif!=1)
            {
                cle=1;
                break;
            }
            }
        }
        coun=0;
        for(x=0;x<n;x++)
        {
            if(x==n-1)dif=arr[n-1]-arr[0];
            else
            dif=arr[x]-arr[x+1];
            if(dif==(1-n))
            {
                coun++;
                if(coun>1)
                {
                    che=1;
                 break;
                }
            }
            else
            if(dif!=1)
            {
                che=1;
                break;
            }
        }
    if(cle*che==0)printf("YES\n");
    else
    printf("NO\n");
    }
}


#include <stdio.h>
int main()
{
    long long n,q,x,che=0,cle=0,dif,coun,k;
    scanf("%lld",&q);
    for(k=0;k<q;k++)
    {
        scanf("%lld",&n);
        long long arr[n];
        for(x=0;x<n;x++)
        scanf("%lld",&arr[x]);
        che=0;
        cle=0;
        coun=0;
        for(x=0;x<n;x++)
        {
            if(x==n-1)dif=arr[0]-arr[n-1];
            else
            dif=arr[x+1]-arr[x];
            if(dif==1-n)
            {
                coun++;
                if(coun>1)
                {
                cle=1;
                 break;
                }
            }
            else
            {
            if(dif!=1)
            {
                cle=1;
                break;
            }
            }
        }
        coun=0;
        for(x=0;x<n;x++)
        {
            if(x==n-1)dif=arr[n-1]-arr[0];
            else
            dif=arr[x]-arr[x+1];
            if(dif==(1-n))
            {
                coun++;
                if(coun>1)
                {
                    che=1;
                 break;
                }
            }
            else
            if(dif!=1)
            {
                che=1;
                break;
            }
        }
    if(cle*che==0)printf("YES\n");
    else
    printf("NO\n");
    }
}


#include<stdio.h>
int shun(int arr[],int nn)
{
    int i,j,p,pan=0;
    arr[nn]=arr[0];
    for(i=1; i<nn; i++)
    {
        if((arr[i]-arr[i-1])==1)
            ;
        else
        {
            p=i;
            pan=1;
            break;
        }
    }
    if(pan==1)
    {
        if(p==nn-1)
        {
            if(arr[0]-arr[nn-1]==1)
                return 1;
            else
                return 0;
        }
        else
        {
            for(i=p; i<nn; i++)
            {
                if((arr[i]-arr[i+1])==1)
                    ;
                else
                    return 0;
            }
        }
    }
    return 1;
}
int ni(int arr[],int nn)
{
    int i,j,p,pan=0;
    arr[nn]=arr[0];
    for(i=0; i<nn; i++)
    {
        if((arr[i]-arr[i+1])==1)
            ;
        else
        {
            p=i+1;
            pan=1;
            break;
        }
    }
    if(pan==1)
    {
        if(p==nn-1)
        {
            if(arr[p]-arr[0]==1)
                return 1;
            else
                return 0;
        }
        else
        {
            for(i=p; i<nn; i++)
            {
                if((arr[i]-arr[i+1])==1)
                    ;
                else
                    return 0;
            }
        }
    }
    return 1;
}
int main()
{
    int i,j,k,n;
    scanf("%d",&n);
    int a[201],student[201][201];
    for(i=0; i<n; i++)
    {
        scanf("%d",&a[i]);
        for(j=0; j<a[i]; j++)
            scanf("%d",&student[i][j]);
    }
    for(i=0; i<n; i++)
    {
        if(shun(&student[i][0],a[i])==1||ni(&student[i][0],a[i])==1)
            printf("Yes\n");
        else
            printf("No\n");

    }
    return 0;
}


#include<stdio.h>
int shun(int arr[],int nn)
{
    int i,j,p,pan=0;
    arr[nn]=arr[0];
    for(i=1; i<nn; i++)
    {
        if((arr[i]-arr[i-1])==1)
            ;
        else
        {
            p=i;
            pan=1;
            break;
        }
    }
    if(pan==1)
    {
        if(p==nn-1)
        {
            if(arr[0]-arr[nn-1]==1)
                return 1;
            else
                return 0;
        }
        else
        {
            for(i=p; i<nn; i++)
            {
                if((arr[i]-arr[i+1])==1)
                    ;
                else
                    return 0;
            }
        }
    }
    return 1;
}
int ni(int arr[],int nn)
{
    int i,j,p,pan=0;
    arr[nn]=arr[0];
    for(i=0; i<nn; i++)
    {
        if((arr[i]-arr[i+1])==1)
            ;
        else
        {
            p=i+1;
            pan=1;
            break;
        }
    }
    if(pan==1)
    {
        for(i=p; i<nn; i++)
        {
            if((arr[i]-arr[i+1])==1)
                ;
            else
                return 0;
        }
    }
    return 1;
}
int main()
{
    int i,j,k,n;
    scanf("%d",&n);
    int a[201],student[201][201];
    for(i=0; i<n; i++)
    {
        scanf("%d",&a[i]);
        for(j=0; j<a[i]; j++)
            scanf("%d",&student[i][j]);
    }
    for(i=0; i<n; i++)
    {
        if(shun(&student[i][0],a[i])==1||ni(&student[i][0],a[i])==1)
            printf("Yes\n");
        else
            printf("No\n");

    }
    return 0;
}


#include<stdio.h>
int shun(int arr[],int nn)
{
    int i,j,p,pan=0;
    arr[nn]=arr[0];
    for(i=1; i<nn; i++)
    {
        if((arr[i]-arr[i-1])==1)
            ;
        else
        {
            p=i;
            pan=1;
            break;
        }
    }
    if(pan==1)
    {
        for(i=p; i<nn; i++)
        {
            if((arr[i]-arr[i+1])==1)
                ;
            else
                return 0;
        }
    }
    return 1;
}
int ni(int arr[],int nn)
{
    int i,j,p,pan=0;
    arr[nn]=arr[0];
    for(i=0; i<nn; i++)
    {
        if((arr[i]-arr[i+1])==1)
            ;
        else
        {
            p=i+1;
            pan=1;
            break;
        }
    }
    if(pan==1)
    {
        for(i=p; i<nn; i++)
        {
            if((arr[i]-arr[i+1])==1)
                ;
            else
                return 0;
        }
    }
    return 1;
}
int main()
{
    int i,j,k,n;
    scanf("%d",&n);
    int a[201],student[201][201];
    for(i=0; i<n; i++)
    {
        scanf("%d",&a[i]);
        for(j=0; j<a[i]; j++)
            scanf("%d",&student[i][j]);
    }
    for(i=0; i<n; i++)
    {
        if(shun(&student[i][0],a[i])==1||ni(&student[i][0],a[i])==1)
            printf("Yes\n");
        else
            printf("No\n");

    }
    return 0;
}


#include<stdio.h>
int shun(int arr[],int nn)
{
    int i,j,p,pan=0;
    arr[nn]=arr[0];
    for(i=1; i<nn; i++)
    {
        if((arr[i]-arr[i-1])==1)
            ;
        else
        {
            p=i;
            pan=1;
            break;
        }
    }
    if(pan==1)
    {
        if(p==nn-1)
        {
            if(arr[0]-arr[nn-1]==1)
                return 1;
            else
                return 0;
        }
        else
        {
            for(i=p; i<nn; i++)
            {
                if((arr[i]-arr[i+1])==1)
                    ;
                else
                    return 0;
            }
        }
    }
    return 1;
}
int ni(int arr[],int nn)
{
    int i,j,p,pan=0;
    arr[nn]=arr[0];
    for(i=0; i<nn; i++)
    {
        if((arr[i]-arr[i+1])==1)
            ;
        else
        {
            p=i+1;
            pan=1;
            break;
        }
    }
    if(pan==1)
    {
        if(p==nn-1)
        {
            if(arr[p]-arr[0]==1)
                return 1;
            else
                return 0;
        }
        else
        {
            for(i=p; i<nn; i++)
            {
                if((arr[i]-arr[i+1])==1)
                    ;
                else
                    return 0;
            }
        }
    }
    return 1;
}
int main()
{
    int i,j,k,n;
    scanf("%d",&n);
    int a[201],student[201][201];
    for(i=0; i<n; i++)
    {
        scanf("%d",&a[i]);
        for(j=0; j<a[i]; j++)
            scanf("%d",&student[i][j]);
    }
    for(i=0; i<n; i++)
    {
        if(shun(&student[i][0],a[i])==1||ni(&student[i][0],a[i])==1)
            printf("YES\n");
        else
            printf("NO\n");

    }
    return 0;
}


#include<stdio.h>
int a[202];
int main()
{
    int T,n;
    scanf("%d",&T);
    while(T--)
    {
        scanf("%d",&n);
        for(int i=0; i<n; i++)
        {
            scanf("%d",&a[i]);
            a[i]-=1;
        }
        int flag1=1;
        int flag2=1;
        for(int i=1; i<n; i++)
        {
            if(a[i]!=(a[i-1]+1)%n)
            {
                flag1=0;
            }
            if(a[i]!=(a[i-1]-1+n)%n)
            {
                flag2=0;
            }
        }
        if(flag1||flag2)
        {
            printf("YES\n");
        }
        else
        {
            printf("NO\n");
        }
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
    int q;
    scanf("%d", &q);
    while(q--)
    {
        int n;
        scanf("%d", &n);
        int *arr = malloc(sizeof(int)*n);
        for(int i=0; i<n; i++)
            scanf("%d", &arr[i]);
        int printer = 0;
        for(int i=1; i<n-1; i++) //0 and n-1 will be considered later
        {
            if(arr[i]!=1 && arr[i]!=n)
            {
                if(arr[i+1]==arr[i]+1 && arr[i-1]==arr[i]-1)
                    continue;
                else if(arr[i-1]==arr[i]+1 && arr[i+1]==arr[i]-1)
                    continue;
                else
                {
                    printer = 1; break;
                }
            }
            else if(arr[i]==1)
            {
                if(arr[i+1]==n || arr[i-1]==n)
                    continue;
                else
                {
                    printer = 1; break;
                }
            }
            else // arr[i]==n
            {   //printf("check\n");
                if(arr[i+1]==1 || arr[i-1]==1)
                    continue;
                else
                {//printf("check\n");
                    printer = 1; break;
                }
            }
        }
        if(arr[0]!=1 && arr[0]!=n && arr[n-1]!=1 && arr[n-1]!=n)
        {
            if((arr[0]+1==arr[1] && arr[0]-1==arr[n-1]) || (arr[0]+1==arr[n-1] && arr[0]-1==arr[1]));
            else    printer = 1;
            if((arr[n-1]+1==arr[n-2] && arr[n-1]-1==arr[0]) || (arr[n-1]+1==arr[0]) && arr[n-1]-1==arr[n-2]);
            else    printer = 1;
        }
        if(arr[0]==1)
        {
            if(arr[1]!=n && arr[n-1]!=n)
                printer = 1;
        }
        if(arr[0]==n)
        {
            if(arr[1]!=1 && arr[n-1]!=1)
                printer = 1;
        }
        if(arr[n-1]==1)
        {
            if(arr[n-2]!=n && arr[0]!=n)
                printer = 1;
        }
        if(arr[n-1]==n)
        {
            if(arr[n-2]!=1 && arr[0]!=1)
                printer = 1;
        }

        if(printer==1)
            printf("NO\n");
        else
            printf("YES\n");
        free(arr);
    }
    return 0;
}


#include <stdio.h>
#include <malloc.h>

int abs(int a)
{
    if (a < 0) return -a;
    return a;
}

int not_check(int prev, int num, int n){
    if (abs(prev - num) == 1 || abs(prev - num) == n-1) return 0;
    return 1;
}

char* solve(){
    int n;
    scanf("%d", &n);
    int* num = (int*)malloc(n* sizeof(int));
    for (int i = 0; i < n; ++i){
        scanf("%d", num+i);
    }
    if (n <= 3) return "YES";
    if (not_check(num[n-1], num[0], n)) return "NO";
    for (int i = 1; i < n; ++i)
    {
        if (not_check(num[i-1], num[i], n)) return "NO";
    }
    return "YES";
}

int main() {
    int q;
    scanf("%d", &q);
    for (int i = 0; i < q; ++i)
    {
        puts(solve());
    }
    return 0;
}


#include <stdio.h>
#include <stdbool.h>

int main()
{
    int q;
    scanf("%d", &q);
    while(q--) {
        int n;
        int p[200];
        scanf("%d", &n);
        for(int i = 0; i < n; ++i) {
            scanf("%d", &p[i]);
            --p[i];
        }
        bool clockwise = true;
        for(int i = 1; i < n; ++i) {
            clockwise &= (p[i] == (p[i - 1] + 1) % n);
        }
        bool counterclockwise = true;
        for(int i = 1; i < n; ++i) {
            counterclockwise &= (p[i] == (p[i - 1] - 1 + n) % n);
        }
        puts(clockwise || counterclockwise ? "YES" : "NO");
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int main()
{
    int q;
    scanf("%d", &q);
    while(q--)
    {
        int a, b, n, i, m=1, t;
        scanf("%d%d", &n, &a);
        i=n;
        while(--n)
        {
            scanf("%d", &b);
            t = abs(b-a);
            if(t!=1 && t!=i-1)
            {
                m=0;
            }
            a = b;
        }
        printf(m ? "YES\n" : "NO\n");
    }

    return 0;
}


#include<stdio.h>
#define N 201
int main(){
    int q;
    scanf("%d",&q);
    int n;
    int p[N];
    int i;
    while(q--){
        scanf("%d",&n);
        for(i=0;i<n;i++){
            scanf("%d",&p[i]);
        }
        int order=1;
        for(i=0;i<n-1;i++){
            if((p[i]+1)%n!=p[i+1]%n){
                order=0;
                break;
            }
        }

        if(order){
            //printf("order 1\n");
            printf("YES\n");
        }else{
            order=1;
            for(i=n-1;i>0;i--){
                //printf("%d %d\n",p[i],p[i-1]);
                if((p[i]+1)%n!=p[i-1]%n){
                    order=0;
                    break;
                }
            }
            if(order){
                //printf("order 2\n");
                printf("YES\n");
            }else{
                printf("NO\n");
                //printf("un order 2\n");
            }
        }
        //printf("\n-------\n");
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void funo(int *arr, int length);

int main()
{
    int input1;
    scanf("%d", &input1);
    int length[input1];
    int *arr[input1];
    for(int i = 0 ; i <input1; i++)
    {
        scanf("%d", (length + i));
        arr[i] = malloc(sizeof(int) * length[i]);
        for(int j = 0 ; j < length[i]; j++)
        {
            scanf("%d", (*(arr + i) + j));
        }
    }
    for(int i = 0 ; i < input1; i++)
    {
        funo(arr[i], length[i]);
    }
    return 0;
}

void funo(int *arr, int length)
{
    if(arr[0] == 1 && length == 1){
        printf("YES\n");
        return;
    }
    int index = 0;
    while(arr[index] != 1)
    {
        index++;
    }
    int R;
    if(index != 0 && arr[index] + 1 == arr[index - 1])
    {
        R = -1;
    }
    else if(index != 0 && arr[index] + 1 == arr[index + 1])
    {
        R = 1;
    }
    else if(index == 0 && arr[index] + 1 == arr[length - 1])
    {
        R = -1;
    }
    else if(index == 0 && arr[index] + 1 == arr[index + 1])
    {
        R = 1;
    }
    else if(index == length - 1 && arr[index] + 1 == arr[index - 1])
    {
        R = -1;
    }
    else if(index == length - 1 && arr[index] + 1 == arr[0])
    {
        R = 1;
    }
    else
    {
        printf("NO\n");
        return;
    }
    int counter = 1;
    for(int i  = index; counter <= length;)
    {
        if(i == 0 && R == -1)
        {
            if(arr[i] + 1 != arr[length - 1])
            {
                printf("NO\n");
                return;
            }
            i = length - 1;
        }
        else if(i == 0 && R == 1)
        {
            if(arr[i] + 1 != arr[i + 1])
            {
                printf("NO\n");
                return;
            }
            i++;
        }
        else if(i == length - 1 && R == -1)
        {
            if(arr[i] + 1 != arr[i - 1])
            {
                printf("NO\n");
                return;
            }
            i--;
        }
        else if(i == length - 1 && R == 1)
        {
            if(arr[i] + 1 != arr[0] && arr[0] != 1)
            {
                printf("NO\n");
                return;
            }
            i = 0;
        }
        else
        {
            if(arr[i] + 1 != arr[i + R] && arr[i + R] != 1)
            {
                printf("NO\n");
                return;
            }
            i += R;
        }
        counter++;
    }
    printf("YES\n");
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void funo(int *arr, int length);
int funo2(int *temp, int length);
int funo3(int *temp, int length);;

int main()
{
    int input1;
    scanf("%d", &input1);
    int length[input1];
    int *arr[input1];
    for(int i = 0 ; i <input1; i++)
    {
        scanf("%d", (length + i));
        arr[i] = malloc(sizeof(int) * length[i]);
        for(int j = 0 ; j < length[i]; j++)
        {
            scanf("%d", (*(arr + i) + j));
        }
        funo(arr[i], length[i]);
    }
    return 0;
}

void funo(int *arr, int length)
{
    if(arr[0] == 1 && length == 1){
        printf("YES\n");
        return;
    }
    int arr2[length * 2];
    int counter = 0;
    for(int i = 0; i < length; i++){
       arr2[counter] = arr[i];
       counter++;
    }
    for(int i = 0; i < length; i++){
       arr2[counter] = arr[i];
       counter++;
    }
    int temp[length];
    for(int i = 0; i < length * 2 - length; i++){
        if(arr2[i] == 1 || arr2[i] == length){
            for(int j = 0; j < length; j++){
                temp[j] = arr2[i + j];
            }
            if(funo2(temp, length) || funo3(temp, length)){
                printf("YES\n");
                return;
            }
        }
    }
    printf("NO\n");
}

int funo2(int *temp, int length){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] + 1 != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}

int funo3(int *temp, int length){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] - 1 != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void funo(int *arr, int length);
int funo2(char *temp, int length);
int funo3(char *temp, int length);;

int main()
{
    int input1;
    scanf("%d", &input1);
    int length[input1];
    int *arr[input1];
    for(int i = 0 ; i <input1; i++)
    {
        scanf("%d", (length + i));
        arr[i] = malloc(sizeof(int) * length[i]);
        for(int j = 0 ; j < length[i]; j++)
        {
            scanf("%d", (*(arr + i) + j));
        }
        funo(arr[i], length[i]);
    }
    return 0;
}

void funo(int *arr, int length)
{
    if(arr[0] == 1 && length == 1){
        printf("YES\n");
        return;
    }
    char temp[length + 1];
    temp[length] = '\0';
    for(int i  = 0; i < length; i++){
        temp[i] = arr[i] + '0';
    }
    char temp2[length * 2 + 1];
    strcpy(temp2, temp);
    strcat(temp2, temp);
    char temp3[length + 1];
    for(int i = 0; i < length * 2 - length; i++){
        if(temp2[i] == '1' || temp2[i] == length + '0'){
            strncpy(temp3, temp2 + i, length);
            temp3[length] = '\0';
            if(funo2(temp3, length) || funo3(temp3, length)){
                printf("YES\n");
                return;
            }
        }
    }
    printf("NO\n");
}

int funo2(char *temp, int length){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] + 1 != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}

int funo3(char *temp, int length){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] - 1 != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void funo(int *arr, int length);
int funo2(int *temp, int length);
int funo3(int *temp, int length);;

int main()
{
    int input1;
    scanf("%d", &input1);
    int length[input1];
    int *arr[input1];
    for(int i = 0 ; i <input1; i++)
    {
        scanf("%d", (length + i));
        arr[i] = malloc(sizeof(int) * length[i]);
        for(int j = 0 ; j < length[i]; j++)
        {
            scanf("%d", (*(arr + i) + j));
        }
        funo(arr[i], length[i]);
    }
    return 0;
}

void funo(int *arr, int length)
{
    if(arr[0] == 1 && length == 1){
        printf("YES\n");
        return;
    }
    int arr2[length * 2];
    int counter = 0;
    for(int i = 0; i < length; i++){
       arr2[counter] = arr[i];
       arr[counter + length] = arr[i];
       counter++;
    }
    for(int i = 0; i < length * 2 - length; i++){
        if(arr2[i] == 1 || arr2[i] == length){
            if(funo2(arr2 + i, length) || funo3(arr2 + i, length)){
                printf("YES\n");
                return;
            }
        }
    }
    printf("NO\n");
}

int funo2(int *temp, int length){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] + 1 != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}

int funo3(int *temp, int length){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] - 1 != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}


#include <stdio.h>
#include <stdlib.h>
int funo2(int *temp, int length);
int funo3(int *temp, int length);;

int main()
{
    int input1, length, *arr, index[2], counter = 0;
    scanf("%d", &input1);
    for(int i = 0 ; i <input1; i++)
    {
        scanf("%d", &length);
        arr = malloc(sizeof(int) * length * 2);
        for(int j = 0 ; j < length; j++)
        {
            scanf("%d", (arr + j));
            arr[j + length] = arr[j];
            if(arr[j] == 1 || arr[j] == length){
                index[counter] = j;
                counter++;
            }
        }
        if(funo2(arr + index[0], length) || funo3(arr + index[0], length)){
                printf("YES\n");
            }
        else if(funo2(arr + index[1], length) || funo3(arr + index[1], length)){
            printf("YES\n");
        }
        else{printf("NO\n");}
        counter = 0;
        free(arr);
    }
    return 0;
}

int funo2(int *temp, int length){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] + 1 != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}

int funo3(int *temp, int length){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] - 1 != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void funo(int *arr, int length);
int funo2(int *temp, int length);
int funo3(int *temp, int length);;

int main()
{
    int input1;
    scanf("%d", &input1);
    int length;
    int *arr;
    for(int i = 0 ; i <input1; i++)
    {
        scanf("%d", &length);
        arr = malloc(sizeof(int) * length);
        for(int j = 0 ; j < length; j++)
        {
            scanf("%d", (arr + j));
        }
        funo(arr, length);
        free(arr);
    }
    return 0;
}

void funo(int *arr, int length)
{
    if(arr[0] == 1 && length == 1){
        printf("YES\n");
        return;
    }
    int arr2[length * 2];
    for(int i = 0; i < length; i++){
       arr2[i] = arr[i];
       arr2[i + length] = arr[i];
    }
    for(int i = 0; i < length * 2 - length; i++){
        if(arr2[i] == 1 || arr2[i] == length){
            if(funo2(arr2 + i, length) || funo3(arr2 + i, length)){
                printf("YES\n");
                return;
            }
        }
    }
    printf("NO\n");
}

int funo2(int *temp, int length){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] + 1 != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}

int funo3(int *temp, int length){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] - 1 != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void funo(int *arr, int length);
int funo2(int *temp, int length);
int funo3(int *temp, int length);;

int main()
{
    int input1;
    scanf("%d", &input1);
    int length;
    int *arr;
    for(int i = 0 ; i <input1; i++)
    {
        scanf("%d", &length);
        arr = malloc(sizeof(int) * length * 2);
        for(int j = 0 ; j < length; j++)
        {
            scanf("%d", (arr + j));
            arr[j + length] = arr[j];
        }
        funo(arr, length);
        free(arr);
    }
    return 0;
}

void funo(int *arr, int length)
{
    if(arr[0] == 1 && length == 1){
        printf("YES\n");
        return;
    }
    for(int i = 0; i < length; i++){
        if(arr[i] == 1 || arr[i] == length){
            if(funo2(arr + i, length) || funo3(arr + i, length)){
                printf("YES\n");
                return;
            }
        }
    }
    printf("NO\n");
}

int funo2(int *temp, int length){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] + 1 != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}

int funo3(int *temp, int length){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] - 1 != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}


#include <stdio.h>
#include <stdlib.h>
int funo2(int *temp, int length);
int funo3(int *temp, int length);;

int main()
{
    int input1, length, *arr, index[2], counter = 0;
    scanf("%d", &input1);
    for(int i = 0 ; i <input1; i++)
    {
        scanf("%d", &length);
        arr = malloc(sizeof(int) * length * 2);
        for(int j = 0 ; j < length; j++)
        {
            scanf("%d", (arr + j));
            arr[j + length] = arr[j];
            if(j < length && (arr[j] == 1 || arr[j] == length)){
                index[counter] = j;
                counter++;
            }
        }
        if(funo2(arr + index[0], length) || funo3(arr + index[1], length)){
                printf("YES\n");
            }
        else{printf("NO\n");}
        counter = 0;
        free(arr);
    }
    return 0;
}

int funo2(int *temp, int length){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] + 1 != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}

int funo3(int *temp, int length){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] - 1 != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void funo(int *arr, int length, int step);
int funo2(char *temp, int length, int step);

int main()
{
    int input1;
    scanf("%d", &input1);
    int length[input1];
    int *arr[input1];
    int f , s;
    for(int i = 0 ; i <input1; i++)
    {
        scanf("%d", (length + i));
        arr[i] = malloc(sizeof(int) * length[i]);
        for(int j = 0 ; j < length[i]; j++)
        {
            scanf("%d", (*(arr + i) + j));
        }
        f = *(*(arr + i) + 0);
        s = *(*(arr + i) + 1);
        funo(arr[i], length[i], (f + 1 != s)?-1:1);
    }
    for(int i = 0 ; i < input1; i++)
    {

    }
    return 0;
}

void funo(int *arr, int length, int step)
{
    if(arr[0] == 1 && length == 1){
        printf("YES\n");
        return;
    }
    char temp[length + 1];
    temp[length] = '\0';
    for(int i  = 0; i < length; i++){
        temp[i] = arr[i] + '0';
    }
    char temp2[length * 2 + 1];
    strcpy(temp2, temp);
    strcat(temp2, temp);
    char temp3[length + 1];
    for(int i = 0; i < length * 2 - length; i++){
        if(temp2[i] == '1' || temp2[i] == length + '0'){
            strncpy(temp3, temp2 + i, length);
            temp3[length] = '\0';
            if(funo2(temp3, length, step)){
                printf("YES\n");
                return;
            }
        }
    }
    printf("NO\n");
}

int funo2(char *temp, int length, int step){
    for(int i = 0; i < length - 1; i++){
        if(temp[i] + step != temp[i + 1]){
            return 0;
        }
    }
    return 1;
}


///I am Groot |*|
#include <stdio.h>

int main()
{
    int q,i,n;
    scanf("%d",&q);
    while(q--)
    {
        scanf("%d",&n);
        int a,b,c=0;
        scanf("%d",&b);
        for(i=1;i<n;i++)
        {
            scanf("%d",&a);
            if(abs(a-b)>1&&abs(a-b)!=n-1)
                c++;
            b=a;
        }
        if(c>0)
            printf("NO\n");
        else
            printf("YES\n");
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
	int n;
	while(~scanf("%d",&n))
	{
		int num[205], m;
		for(int i=0;i<n;i++)
		{
			scanf("%d",&m);
			int j, flag=0, t;
			memset(num,0,sizeof(num));
			for(j=0;j<m;j++)
			{
				scanf("%d",&num[j]);
			}
			j=0;
			while(num[j]!=1)
			{
				j++;
			}
			if(num[(j+1)%m]==2)
			{
				t=j+1;
				for(int a=0;a<m-2;a++)
				{
					if(num[(t+a+1)%m]-num[(t+a)%m]!=1)	flag=1;
				}
			}
			else if(num[(j-1+m)%m]==2)
			{
				t=(j-1+m)%m;
				for(int a=0;a<m-2;a++)
				{
					if(num[(t-a-1+m)%m]-num[(t-a+m)%m]!=1)	flag=1;
				}
			}
			else flag=1;
			if(flag) printf("NO\n");
			else printf("YES\n");
		}
	}
	return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
	int n;
	while(~scanf("%d",&n))
	{
		int num[205], m;
		for(int i=0;i<n;i++)
		{
			scanf("%d",&m);
			int j, flag=0, t;
			memset(num,0,sizeof(num));
			for(j=0;j<m;j++)
			{
				scanf("%d",&num[j]);
			}
			j=0;
			while(num[j]!=1)
			{
				j++;
			}
			if(num[j+1]>num[j+2])
			{
				for(t=j+1;t<m-1;t++)
				{
					if(num[t]-num[t+1]!=1)	flag=1;
				}
				for(t=j-1;t>0;t--)
				{
					if(num[t-1]-num[t]!=1)	flag=1;
				}
			}
			else
			{
				for(t=j+1;t<m-1;t++)
				{
					if(num[t+1]-num[t]!=1)	flag=1;
				}
				for(t=j-1;t>0;t--)
				{
					if(num[t-1]-num[t]!=1)	flag=1;
				}
			}
			if(flag) printf("NO\n");
			else printf("YES\n");
		}
	}
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
	int n;
	while(~scanf("%d",&n))
	{
		int num[205], m;
		for(int i=0;i<n;i++)
		{
			scanf("%d",&m);
			int j, flag=0, t;
			memset(num,0,sizeof(num));
			for(j=0;j<m;j++)
			{
				scanf("%d",&num[j]);
			}
			j=0;
			while(num[j]!=1)
			{
				j++;
			}
			for(t=j+1;t<m-1;t++)
			{
				if(fabs(num[t]-num[t+1])!=1)	flag=1;
			}
			for(t=j-1;t>0;t--)
			{
				if(fabs(num[t]-num[t-1])!=1)	flag=1;
			}
			if(flag) printf("NO\n");
			else printf("YES\n");
		}
	}
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
	int n;
	while(~scanf("%d",&n))
	{
		int num[205], m;
		for(int i=0;i<n;i++)
		{
			scanf("%d",&m);
			int j, flag=0, t;
			memset(num,0,sizeof(num));
			for(j=0;j<m;j++)
			{
				scanf("%d",&num[j]);
			}
			j=0;
			while(num[j]!=1)
			{
				j++;
			}
			if(num[(j+1)%m]==2)
			{
				t=j+1;
				for(int a=0;a<m-2;a++)
				{
					if(num[(t+a+1)%m]-num[(t+a)%m]!=1)	flag=1;
				}
			}
			else if(num[(j-1+m)%m]==2)
			{
				t=(j-1+m)%m;
				for(int a=0;a<m-2;a++)
				{
					if(num[(t-a-1+m)%m]-num[(t-a+m)%m]!=1)	flag=1;
				}
			}
			else flag=1;
			if(flag&&m!=1) printf("NO\n");
			else printf("YES\n");
		}
	}
	return 0;
}


#include<bits/stdc++.h>
int main()
{
	int n;
	while(~scanf("%d",&n))
	{
		int num[205], m;
		for(int i=0;i<n;i++)
		{
			scanf("%d",&m);
			int j, flag=0, t;
			memset(num,0,sizeof(num));
			for(j=0;j<m;j++)
			{
				scanf("%d",&num[j]);
			}
			j=0;
			while(num[j]!=1)
			{
				j++;
			}
			for(t=j+1;t<m-1;t++)
			{
				if(fabs(num[t]-num[t+1])!=1)	flag=1;
			}
			for(t=j-1;t>0;t--)
			{
				if(fabs(num[t]-num[t+1])!=1)	flag=1;
			}
			if(flag) printf("NO\n");
			else printf("YES\n");
		}
	}
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
	int n;
	while(~scanf("%d",&n))
	{
		int num[205], m;
		for(int i=0;i<n;i++)
		{
			scanf("%d",&m);
			int j, flag=0, t;
			memset(num,0,sizeof(num));
			for(j=0;j<m;j++)
			{
				scanf("%d",&num[j]);
			}
			j=0;
			while(num[j]!=1)
			{
				j++;
			}
			for(t=j+1;t<m-1;t++)
			{
				if(fabs(num[t]-num[t+1])!=1)	flag=1;
			}
			for(t=j-1;t>0;t--)
			{
				if(fabs(num[t]-num[t+1])!=1)	flag=1;
			}
			if(flag) printf("NO\n");
			else printf("YES\n");
		}
	}
	return 0;
}


#include <stdio.h>
#define rep(i,a,b) for (int i=a; i<b; i++)
void read(int *arr, int length) {
    rep (i,0,length) scanf("%d",(arr+i));
}
void print(int *arr, int length) {
    rep (i,0,length) printf("%d ",*(arr+i));
    printf("\n");
}
void invert(int *arr, int start, int end) {
    int mid=(end-start-1)/2,temp;
    rep (i,0,mid+1) {
        temp=arr[start+i];
        arr[start+i]=arr[end-i-1];
        arr[end-i-1]=temp;
    }
}
int clockwise(int *arr, int length) {
    if (arr[length-1]==length) {
        rep (i,0,length) {
            if (arr[i]!=(i+1)) return 0;
        }
        return 1;
    } else {
        int j=0;
        while (arr[j]!=length) j++;
        invert(arr,0,j);
        invert(arr,j,length);
        rep (i,0,length) {
            if (arr[i]!=(i+1)) return 0;
        }
        return 1;
    }
}
int main() {
    int queries,len;
    scanf("%d\n",&queries);
    for (int i=0; i<queries; i++) {
        scanf("%d\n",&len);
        int st[len];
        read(st,len);
        if (clockwise(st,len)) {
            printf("YES\n");
        } else {
            printf("NO\n");
        }
    }
    return 0;
}


#include <stdio.h>
#define rep(i,a,b) for (int i=a; i<b; i++)
void read(int *arr, int length) {
    rep (i,0,length) scanf("%d",(arr+i));
    scanf("\n");
}
int clockwise(int *arr, int length) {
    rep (i,0,length) {
        if (arr[i]!=(i+1)) return 0;
    }
    return 1;
}
int counterclockwise(int *arr, int length) {
    rep (i,0,length) {
        if (arr[i]!=(length-i)) return 0;
    }
    return 1;
}
void invert(int *arr, int s, int e) {
    int mid=(e-1-s)/2+1,temp;
    rep (i,0,mid) {
        temp=arr[s+i];
        arr[s+i]=arr[e-1-i];
        arr[e-1-i]=temp;
    }
}
void shift(int *arro, int *arrt, int length, int ind) {
    rep (i,0,length-ind) {
        *(arrt+i)=*(arro+ind+i);
    }
    rep (i,0,ind) {
        *(arrt+length-ind+i)=*(arro+i);
    }
}
int round_dance(int *arr, int length) {
    if (clockwise(arr,length)) {
        return 1;
    } else if (counterclockwise(arr,length)) {
        return 1;
    } else {
        int save[length],j=0;
        while (arr[j]!=length) j++;
        shift(arr,save,length,j);
        if (counterclockwise(save,length)) {
            return 1;
        } else {
            invert(save,1,length);
            return counterclockwise(save,length);
        }
    }
}
int main() {
    int queries,len;
    scanf("%d\n",&queries);
    for (int i=0; i<queries; i++) {
        scanf("%d\n",&len);
        int st[len];
        read(st,len);
        if (round_dance(st,len)) {
            printf("YES\n");
        } else {
            printf("NO\n");
        }
    }
    return 0;
}