stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <iostream>

//#include <sstream>

#include <string>

#include <algorithm>

#include <cstdio>

#include <cstring>

#include <map>

#include <set>

#include <queue>

#include <vector>

#include <cmath>

//#include <functional>

//#define LL long long



using namespace std;





const int maxn = 100005;

long long a[maxn];

long long b[maxn];



int main()

{

//    printf("ok");

#ifdef LOCAL

//    freopen("/Users/ecooodt/Desktop/c++ and acm/DI2_lesson/2/2.txt","r",stdin);

#endif

//    printf("%d",-5%5)

    memset(a,0,sizeof(a));

    long long n,m;

    scanf("%lld",&n);

    long long sum = 0;

    for(int i = 0; i < n; i++)

    {

        scanf("%lld",&a[i]);

        sum += a[i];

    }

    long long t = n*(1+n)/2;

    if(sum % t != 0)

    {

        printf("NO\n");

        return 0;

    }

    sum /= t;



    for(int i = 1; i < n; i++)

    {

        b[i-1] = a[i-1] - a[i];

    }

    b[n-1] = a[n-1] - a[0];





    for(int i = 0 ; i < n ; i++)

    {

        b[i] += sum;

        if(b[i] == 0)

        {

            continue;

        }

//        printf("%d\n",b[i]);

        if(b[i] % n != 0 || b[i] < 0)

        {

            printf("NO\n");

            return 0;

        }

    }

    printf("YES\n");

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define fi first

#define se second

#define pb push_back

#define eb emplace_back

using namespace std;

typedef long long LL;

typedef pair<int,int> pii;

typedef vector<int> vi;



template<class T> inline T re(){

	T N = 0; char c = getchar(); bool neg = 0;

	for (; c < '0' || c > '9'; c = getchar()) neg |= c == '-';

	for (; c >= '0' && c <= '9'; c = getchar())

		N = (N<<3)+(N<<1) + c - '0';

	return neg ? -N : N;

}



const int mxsz = 1e5 + 3;

int n;

LL a[mxsz], d[mxsz];



inline void CANNOT(){

	puts("NO"); exit(0);

}

int main(){

	n = re<int>();

	for (int i = 1; i <= n; i++) a[i] = re<LL>();

	a[n+1] = a[1];

	LL totdiff = 0, tot = 0, add = 1LL * n * (n+1) / 2;

	for (int i = 1; i <= n; i++){

		totdiff += (d[i] = a[i] - a[i+1]);

		tot += a[i];

	}

	if (tot % add != 0) CANNOT();

	if (totdiff != 0) CANNOT();

	LL m = tot / add;

	LL totx = 0;

	for (int i = 1; i <= n; i++){

		if ((d[i] + m) % n != 0){

			CANNOT();

		}

		LL tmp = (d[i] + m) / n;

		if (tmp < 0) CANNOT();

		totx += tmp;

	}

	if (totx != m) CANNOT();

	cout << "YES\n";

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <iomanip>

#include <cstdio>

#include <string>

#include <cstring>

#include <deque>

#include <list>

#include <queue>

#include <stack>

#include <vector>

#include <utility>

#include <algorithm>

#include <map>

#include <set>

#include <complex>

#include <cmath>

#include <limits>

#include <cfloat>

#include <climits>

#include <ctime>

#include <cassert>

using namespace std;



#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)

#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)

#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)

#define all(v) begin(v), end(v)

#define pb(a) push_back(a)

#define fr first

#define sc second

#define INF 2000000000

#define int long long int



#define X real()

#define Y imag()

#define EPS (1e-10)

#define EQ(a,b) (abs((a) - (b)) < EPS)

#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )

#define LE(n, m) ((n) < (m) + EPS)

#define LEQ(n, m) ((n) <= (m) + EPS)

#define GE(n, m) ((n) + EPS > (m))

#define GEQ(n, m) ((n) + EPS >= (m))



typedef vector<int> VI;

typedef vector<VI> MAT;

typedef pair<int, int> pii;

typedef long long ll;



typedef complex<double> P;

typedef pair<P, P> L;

typedef pair<P, double> C;



int dy[]={0, 0, 1, -1};

int dx[]={1, -1, 0, 0};

int const MOD = 1000000007;



namespace std {

    bool operator<(const P& a, const P& b) {

        return a.X != b.X ? a.X < b.X : a.Y < b.Y;

    }

}



signed main() {

    int n; cin >> n;

    int a[100010] = {};

    int sum = 0;



    rep(i,0,n) {

        cin >> a[i];

        sum += a[i];

    }



    int cs[100010] = {};

    int ret[100010] = {};

    int cntnum = 0;



    if(sum % (n * (n+1) / 2)) cout << "NO" << endl;

    else {

        cntnum = sum / (n*(n+1) / 2);

        rep(i,0,n) {

            int prev = (i - 1 + n) % n;

            int s = a[prev] - a[i];

            if( (s+cntnum) % n != 0 || (s + cntnum) / n < 0) {

                cout << "NO" << endl;

                return 0;

            }

            cs[i] += (s + cntnum) / n;

        }

        rep(i,0,n) ret[0] += cs[i] * ((n - i) % n + 1);

        rep(i,1,n) ret[i] = ret[i-1] - cs[i] * n + cntnum;

        rep(i,0,n) {

            if(ret[i] != a[i]) {

                cout << "NO" << endl;

                return 0;

            }

        }

        cout << "YES" << endl;

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

using namespace std;



long long int N, A[100010];

int main() {

    scanf("%lld", &N);

    long long int sum = 0, div = N*(N+1)/2;

    for(int i=0; i<N; i++) {

        scanf("%lld", &A[i]);

        sum += A[i];

    }



    bool ok = (sum % div == 0);

    long long int sum_op = sum / div;

    for(int i=0; i<N; i++) {

        long long int val = A[i] - A[(i+1)%N] + sum_op;

        ok &= (val >= 0 && val % N == 0);

    }

    printf("%s\n", ok ? "YES" : "NO");

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <iomanip>

#include <cstdio>

#include <string>

#include <cstring>

#include <deque>

#include <list>

#include <queue>

#include <stack>

#include <vector>

#include <utility>

#include <algorithm>

#include <map>

#include <set>

#include <complex>

#include <cmath>

#include <limits>

#include <cfloat>

#include <climits>

#include <ctime>

#include <cassert>

using namespace std;



#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)

#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)

#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)

#define all(v) begin(v), end(v)

#define pb(a) push_back(a)

#define fr first

#define sc second

#define INF 2000000000

#define int long long int



#define X real()

#define Y imag()

#define EPS (1e-10)

#define EQ(a,b) (abs((a) - (b)) < EPS)

#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )

#define LE(n, m) ((n) < (m) + EPS)

#define LEQ(n, m) ((n) <= (m) + EPS)

#define GE(n, m) ((n) + EPS > (m))

#define GEQ(n, m) ((n) + EPS >= (m))



typedef vector<int> VI;

typedef vector<VI> MAT;

typedef pair<int, int> pii;

typedef long long ll;



typedef complex<double> P;

typedef pair<P, P> L;

typedef pair<P, double> C;



int dy[]={0, 0, 1, -1};

int dx[]={1, -1, 0, 0};

int const MOD = 1000000007;



namespace std {

    bool operator<(const P& a, const P& b) {

        return a.X != b.X ? a.X < b.X : a.Y < b.Y;

    }

}



signed main() {

    int n; cin >> n;

    int a[100010] = {};

    int sum = 0;



    rep(i,0,n) {

        cin >> a[i];

        sum += a[i];

    }



    int cs[100010] = {};

    int ret[100010] = {};

    int cntnum = 0;



    if(sum % (n * (n+1) / 2)) cout << "NO" << endl;

    else {

        cntnum = sum / (n*(n+1) / 2);

        rep(i,0,n) {

            int prev = (i - 1 + n) % n;

            int s = a[prev] - a[i];

            // n で割り切れなければ操作回数が小数になるので不適

            // 結果が負になるのも不適 (操作回数は非負整数)

            if( (s+cntnum) % n != 0 || (s + cntnum) / n < 0) {

                cout << "NO" << endl;

                return 0;

            }

            cs[i] += (s + cntnum) / n;

        }

        /*

        rep(i,0,n) ret[0] += cs[i] * ((n - i) % n + 1);

        rep(i,1,n) ret[i] = ret[i-1] - cs[i] * n + cntnum;

        rep(i,0,n) {

            if(ret[i] != a[i]) {

                cout << "NO" << endl;

                return 0;

            }

        }

        */

        cout << "YES" << endl;

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

using namespace std;



long long int N, A[100010];

int main() {

    scanf("%lld", &N);

    long long int sum = 0, div = N*(N+1)/2;

    for(int i=0; i<N; i++) {

        scanf("%lld", &A[i]);

        sum += A[i];

    }



    bool ok = (sum % div == 0);

    long long int sum_op = sum / div;

    for(int i=0; i<N; i++) {

        long long int val = A[i] - A[(i+1)%N] + sum_op;

        ok &= (val >= 0 && val % N == 0);

    }

    printf("%s\n", ok ? "YES" : "NO");

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
// be name khoda

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

#define pb push_back

const ll maxn=3*1e5+5;

ll a[maxn];

int main()

{

	ll n;cin >> n;

	ll s=0; ll s1=n*(n+1)/2;

	for(ll i=0;i<n;i++)

	{

		cin >> a[i];

		s+=a[i];

	}

	if (n==1)

	{

		cout << "YES";

		return 0;

	}

	if (s%s1!=0)

	{

		cout << "NO";

		return 0;

	}

	s1=s/s1;

	ll s2=s1; ll y=0;

	for(ll i=0;i<n;i++)

	{

		y=a[i]-a[(i+1)%n]+s1;

		if (y<0 || y%n)

		{

			cout << "NO";

			return 0;

		}

		s2-=y/n;

	}

	if (s2==0) cout<<"YES"; else cout<<"NO"; 

}


// Optimized solution to the same problem (faster):
#include<cstdio>

typedef long long lger;

inline lger read(){

    lger x=0,f=1;char ch=getchar();

    while(ch<'0'||ch>'9') {if(ch=='-')f=-1;ch=getchar();}

    while(ch>='0'&&ch<='9') {x=x*10+ch-'0';ch=getchar();}

    return x*f;

}

lger n,num[100050],sum;

int main(){

	n=read();

	for(int i=1;i<=n;i++){num[i]=read();sum+=num[i];}

	if(sum%(n*(n+1)/2)!=0){puts("NO"); return 0;}

	lger round=sum/(n*(n+1)/2);

	lger flag=0;

	if((round-num[1]+num[n])%n!=0||round-num[1]+num[n]<0){puts("NO"); return 0;}

	else flag+=(round-num[1]+num[n])/n;

	for(int i=2;i<=n;i++)

		if((round-num[i]+num[i-1])%n!=0||round-num[i]+num[i-1]<0){

			puts("NO"); return 0;

		}

		else flag+=(round-num[i]+num[i-1])/n;

	puts(flag==round?"YES":"NO");

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>



using namespace std;

using namespace __gnu_pbds;



#define fi first

#define se second

#define mp make_pair

#define pb push_back

#define fbo find_by_order

#define ook order_of_key



typedef long long ll;

typedef pair<ll,ll> ii;

typedef vector<int> vi;

typedef long double ld; 

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

typedef set<int>::iterator sit;

typedef map<int,int>::iterator mit;

typedef vector<int>::iterator vit;



ll n;

ll a[100001];



int main()

{

	ios_base::sync_with_stdio(0); cin.tie(0);

	cin>>n;

	for(int i = 0; i < n; i++)

	{

		cin>>a[i];

	}

	ll sum = 0;

	for(int i = 0; i < n; i++)

	{

		sum+=a[i];

	}

	ll tot = (ll(n)*ll(n+1))/2;

	if(sum%tot==0)

	{

		ll xsum = sum/tot;

		for(int i = 1; i <= n; i++)

		{

			int u = i; int v = i-1;

			if(u==n) u=0;

			ll diff = a[u] - a[v];

			ll nx2 = xsum - diff;

			if(nx2<0)

			{

				cout<<"NO\n";

				return 0;

			}

			if(nx2%n==0)

			{

				

			}

			else

			{

				cout<<"NO\n";

				return 0;

			}

		}	

		cout<<"YES\n";

	}

	else

	{

		cout<<"NO\n";

	}

}


// Optimized solution to the same problem (faster):
#include<cstdio>

typedef long long lger;

inline lger read(){

    lger x=0,f=1;char ch=getchar();

    while(ch<'0'||ch>'9') {if(ch=='-')f=-1;ch=getchar();}

    while(ch>='0'&&ch<='9') {x=x*10+ch-'0';ch=getchar();}

    return x*f;

}

lger n,num[100050],sum;

int main(){

	n=read();

	for(int i=1;i<=n;i++){num[i]=read();sum+=num[i];}

	if(sum%(n*(n+1)/2)!=0){puts("NO"); return 0;}

	lger round=sum/(n*(n+1)/2);

	lger flag=0;

	if((round-num[1]+num[n])%n!=0||round-num[1]+num[n]<0){puts("NO"); return 0;}

	else flag+=(round-num[1]+num[n])/n;

	for(int i=2;i<=n;i++)

		if((round-num[i]+num[i-1])%n!=0||round-num[i]+num[i-1]<0){

			puts("NO"); return 0;

		}

		else flag+=(round-num[i]+num[i-1])/n;

	puts(flag==round?"YES":"NO");

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#include<iostream>

#include<string>

#include<vector>

#include<map>

using namespace std;

#define pb push_back

#define mp make_pair

#define fi first

#define se second



typedef long long ll;

typedef long double ld;

typedef unsigned long long  ull;

typedef vector<int> vi;



struct pp{ll x,y;};



const int base = 1000*1000*1000;

const int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

const int inf = (int)1e9;

const int mod = 1e9+7;

ll gcd (ll a, ll b) {

        while (b) {

            a %= b;

            swap (a, b);

        }

        return a;

}



/*

void quickSort(int left, int right) {

      int i = left, j = right;

      pp tmp;

      int pivot = a[(left + right) / 2].x;

      while (i <= j) {

            while (a[i].x < pivot)

                  i++;

            while (a[j].x > pivot)

                  j--;

            if (i <= j) {

                 swap(a[i],a[j]);

                  i++,j--;

            }

      };

    if (left < j)

            quickSort(left, j);

      if (i < right)

            quickSort(i, right);

}*/

ll binpow (ll a, ll n) {

	ll res = 1;

	while (n) {

		if (n & 1)

			res *= a,res %= mod;

		a *= a,a %= mod;

		n >>= 1;

	}

	return res;

}

const int MaxN = 1e5 + 17;

ll a[111111],n,sum;

int main(){

    cin>>n;

    for(ll i=0;i<n;i++){

        cin>>a[i];

        sum+=a[i];

    }

    if(sum%(n*(n+1)/2)){

        cout<<"NO";

        return 0;

    }

    ll x=sum/(n*(n+1)/2),cnt=0;

    for(ll i=0;i<n;i++)if(a[i]<x){

        cout<<"NO";

        return 0;

    }

    for(ll i=1;i<=n;i++){

        ll b=a[i%n]-a[i-1];

        if(abs(b+(n-1)*x)%n||b+(n-1)*x<0){

            cout<<"NO";

            return 0;

        }

        else cnt+=x-(b+(n-1)*x)/n;

    }

    cout<<"YES";



    return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

typedef long long lger;

inline lger read(){

    lger x=0,f=1;char ch=getchar();

    while(ch<'0'||ch>'9') {if(ch=='-')f=-1;ch=getchar();}

    while(ch>='0'&&ch<='9') {x=x*10+ch-'0';ch=getchar();}

    return x*f;

}

lger n,num[100050],sum;

int main(){

	n=read();

	for(int i=1;i<=n;i++){num[i]=read();sum+=num[i];}

	if(sum%(n*(n+1)/2)!=0){puts("NO"); return 0;}

	lger round=sum/(n*(n+1)/2);

	lger flag=0;

	if((round-num[1]+num[n])%n!=0||round-num[1]+num[n]<0){puts("NO"); return 0;}

	else flag+=(round-num[1]+num[n])/n;

	for(int i=2;i<=n;i++)

		if((round-num[i]+num[i-1])%n!=0||round-num[i]+num[i-1]<0){

			puts("NO"); return 0;

		}

		else flag+=(round-num[i]+num[i-1])/n;

	puts(flag==round?"YES":"NO");

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define ll long long

using namespace std;

int n,a[100005],s[100005];

ll sum,turn;

bool flag=1;

inline int read(){

    int x=0,f=1;char ch=getchar();

    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}

    while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}

    return x*f;

}

int main(){

    n=read();

    for(int i=1;i<=n;++i) a[i]=read(),sum+=a[i];

    if(sum%(1ll*n*(n+1)/2)) return 0*puts("NO");

    turn=sum/(1ll*n*(n+1)/2);

    for(int i=1;i<=n;++i) s[i]=a[i%n+1]-a[i];

    for(int i=1;i<=n;++i) if(s[i]-turn>0||(-s[i]+turn)%n) flag=0;

    if(flag) puts("YES");

	else puts("NO");

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#define N 110000

inline char gc(){

    static char now[1<<16],*T,*S;

    if (T==S){T=(S=now)+fread(now,1,1<<16,stdin);if (T==S) return EOF;}

    return *S++;

}

inline int read(){

    int x=0;char ch=gc();

    while (ch<'0'||ch>'9') ch=gc();

    while (ch<='9'&&ch>='0'){x=x*10+ch-'0';ch=gc();}

    return x;

}

int n,a[N],differ[N];

int main(){

    n=read();long long sum=0;long long sum1=0;

    if (n==1){printf("YES");return 0;}

    sum1=(long long)n*(n+1)>>1;

    for (int i=1;i<=n;++i) a[i]=read(),sum+=a[i];a[n+1]=a[1];

    for (int i=1;i<=n;++i) differ[i]=a[i+1]-a[i];int k=sum/sum1;

    if (sum%sum1){printf("NO");return 0;}

    for (int i=1;i<=n;++i){

        double x=(differ[i]-k)/(-1.0*n);

        if (x<0){printf("NO");return 0;}

        int xx=x;if (xx!=x){printf("NO");return 0;}

    }

    printf("YES");

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



long long int n,x=0,k=0,o=0,u=0,s=0,l=1e10,a[300000];

int main()

{

	ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);

	cin >> n;

	

	for(int i=1; i<=n; i++)	

	{

		cin >> a[i];

		s+=a[i];

		k=max(k,a[i]);

		l=min(l,a[i]);

	}

	x=n*(n+1);

	x/=2;

	if(s%x!=0)

	{

		cout << "NO";

		return 0;

	}

	x=s/x;

	if(l<x || n*x<k)

	{

                cout << "NO";

                return 0;

        }

	s=0;

	//cout << "OK";

	for(int i=1; i<=n; i++)

        {

		if(i<n)

                	l=a[i+1]-a[i];

		else

			l=a[1]-a[n];

		k=x;

		if(l>=0)

		{

			k-=l;

			if(k%n!=0)

			{

				cout << "NO";

				return 0;

			}

			k/=n;

			s+=k;

		}

		else

		{

			l*=-1;

			o=l%(n-1);

			if(o>0)

				o=n-1-o;	

			l+=o;

			l/=(n-1);

			k-=o;

			k-=l;

			if(k%n!=0)

                        {

                                cout << "NO";

                                return 0;

                        }

			k/=n;

			k+=l;

			s+=k;

		}	

		//cout << i << ' ' << s << endl;

        }	

	//cout << s << " OK" << endl;

	if(s!=x)

	{

		cout << "NO";

		return 0;

	}

	cout << "YES";

	return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#define N 110000

inline char gc(){

	static char now[1<<16],*T,*S;

	if (T==S){T=(S=now)+fread(now,1,1<<16,stdin);if (T==S) return EOF;}

	return *S++;

}

inline int read(){

	int x=0;char ch=gc();

	while (ch<'0'||ch>'9') ch=gc();

	while (ch<='9'&&ch>='0'){x=x*10+ch-'0';ch=gc();}

	return x;

}

int n,a[N],differ[N];

int main(){

	//freopen("box.in","r",stdin);

	n=read();long long sum=0;long long sum1=0;

	if (n==1){printf("YES");return 0;}

	sum1=(long long)n*(n+1)>>1;

	for (int i=1;i<=n;++i) a[i]=read(),sum+=a[i];a[n+1]=a[1];

	for (int i=1;i<=n;++i) differ[i]=a[i+1]-a[i];int k=sum/sum1;

	if (sum%sum1){printf("NO");return 0;}

	for (int i=1;i<=n;++i){

		double x=(differ[i]-k)/(-1.0*n);

		if (x<0){printf("NO");return 0;}

		int xx=x;if (xx!=x){printf("NO");return 0;}

	}

	printf("YES");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

 

using namespace std;

 

int n, k, ta, tb, ma;

 

int gcd(int a, int b) {

	if (b == 0)

		return a;

	return gcd(b, a % b);

}

 

int main() {

	scanf("%d%d", &n, &k);

	scanf("%d", &ta);

	ma = ta;

	n--;

	while (n--) {

		scanf("%d", &tb);

		ma = max(ma, tb);

		ta = gcd(ta, tb);

	}

	if (ma >= k && (ma - k) % ta == 0)

		printf("POSSIBLE\n");

	else

		printf("IMPOSSIBLE\n");

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

using namespace std;



int n, k, r, a, maxa; 

int gcd(int a, int b) {

	return b == 0 ? a : gcd(b, a % b);

}

int main(void) {

	scanf("%d%d%d", &n, &k, &r);

	maxa = r;

	for (int i = 1; i < n; i++) {

		scanf("%d", &a);

		r = gcd(r, a);

		maxa = max(maxa, a);

	}

	if (!(k % r) && k <= maxa)

		printf("POSSIBLE");

	else

		printf("IMPOSSIBLE");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

using namespace std;

int n, k, a, g, mx;

int gcd(int p, int q) {return q ? gcd(q,p%q) : p;}

int main() {

	scanf("%d%d", &n, &k);

	for(int i=0; i<n; i++) {

		scanf("%d", &a);

		g = gcd(i?g:a, a);

		mx = max(mx, a);

	}

	printf("%sPOSSIBLE", k%g || k>mx ? "IM":"");

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>

int n, k, a, g, mx;

int main() {

	scanf("%d%d", &n, &k);

	while(n--) {

		scanf("%d", &a);

		g = std::__gcd(g, a);

		if(a>mx) mx = a;

	}

	printf("%sPOSSIBLE", k%g || k>mx ? "IM":"");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



#define MAX_N 100010

int a[MAX_N];



int gcd(int s, int t)

{

    if (t == 0) return s;

    return gcd(t, s % t);

}



int main(void)

{

    int n, k;

    bool flag = false;;

    scanf("%d%d", &n, &k);

    for (int i = 0; i < n; i++) scanf("%d", &a[i]);

    sort(a, a + n);

    for (int i = 0; i < n; i++) if (k == a[i]) flag = true;

    if (!flag) {

        if (n == 1) flag = false;

        else if (k > a[n - 1]) flag = false;

        else {

            int _gcd = gcd(a[0], a[1]);

            for (int i = 1; i < n - 1; i++)

                _gcd = gcd(a[i], _gcd);

            if (_gcd == 1) flag = true;

            else if (gcd(k, _gcd) > 1) flag = true;

        }

    }

    if (flag) printf("POSSIBLE\n");

    else printf("IMPOSSIBLE\n");

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



#define MAX_N 100010

int a[MAX_N];



int gcd(int s, int t)

{

    if (t == 0) return s;

    return gcd(t, s % t);

}



int main(void)

{

    int n, k;

    scanf("%d%d", &n, &k);

    int Max = 0;

    for (int i = 0; i < n; i++) {

        scanf("%d", &a[i]);

        Max = a[i] > Max? a[i]: Max;

    }

    bool flag = false;

    for (int i = 0; i < n; i++)

        if (k == a[i])

            flag = true;

    if (!flag) {

        if (n == 1) flag = false;

        else if (k > Max) flag = false;

        else {

            int Gcd = a[0];

            for (int i = 1; i < n; i++)

                Gcd = gcd(a[i], Gcd);

            if (Gcd == 1) flag = true;

            else if (gcd(k, Gcd) > 1) flag = true;

        }

    }

    if (flag) printf("POSSIBLE\n");

    else printf("IMPOSSIBLE\n");

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int gcd(int a, int b) {

  if(b == 0) return a;

  else return gcd(b, a%b);

}



int main() {

  int N, K; cin >> N >> K;

  int g = -1, m = -1;

  for(int i=0; i<N; i++) {

    int p; cin >> p;

    if(i == 0) g = p;

    else g = gcd(g, p);

    m = max(m, p);

  }

  if(K % g == 0 && K <= m) cout << "POSSIBLE" << endl;

  else cout << "IMPOSSIBLE" << endl;

  return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

using namespace std;



int gcd(int a, int b) {

    return b ? gcd(b, a%b) : a;

}



int main() {

    int N, K; scanf("%d%d", &N, &K);

    int g = -1, ma = 0;

    for(int i=0; i<N; i++) {

        int p; scanf("%d", &p);

        if(g < 0) g = p;

        else g = gcd(g, p);

        if(ma < p) ma = p;

    }



    printf("%s\n", (K % g || K > ma ? "IMPOSSIBLE" : "POSSIBLE"));

    return 0;

}

// Fastest known solution for this problem: