stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.370509288365813x):
#include<cstdio>

#include<cctype>

#include<cstring>

#include<cmath>

#include<algorithm>

#define max(a,b) (a>b?a:b)

#define min(a,b) (a<b?a:b)

#define reg register

typedef long long ll;

template<typename T>inline T read(){

    reg T x=0;reg short f=1;reg char c=getchar();

    for(;!isdigit(c);f=c=='-'?-1:1,c=getchar());

    for(;isdigit(c);x=x*10+(c^48),c=getchar());

    return x*f;

}

const int maxn=1e5+5;

int n;

ll a[maxn],s[maxn],sum;

int main(){

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

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

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

	for(reg int i=1;i<=n;i++)if(s[i]<0||s[i]%n)return 0*puts("NO");

	return 0*puts("YES");

}
// Slower C++ solution:
// 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"; 

}


// Faster C++ solution for the same problem (measured speedup: 5.28728757201944x):
#include<cstdio>

int n,a[100001];

long long S,T;

int main(){

	scanf("%d",&n);

	if(n==1) return 0*puts("YES");

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

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

		scanf("%d",a+i), S+=a[i];

	if(S%T) return 0*puts("NO");

	S/=T;

	a[0]=a[n];

	for(int i=n;i>=1;--i)

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

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

		a[i]-=S;

	int ok=1;

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

		if(a[i]>0||a[i]%n) ok=0;

	puts(ok?"YES":"NO");

	return 0;

}
// Slower C++ solution:
#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";

	}

}


// Faster C++ solution for the same problem (measured speedup: 5.364930334733131x):
#include<cstdio>

int n,a[100001];

long long S,T;

int main(){

	scanf("%d",&n);

	if(n==1) return 0*puts("YES");

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

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

		scanf("%d",a+i), S+=a[i];

	if(S%T) return 0*puts("NO");

	S/=T;

	a[0]=a[n];

	for(int i=n;i>=1;--i)

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

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

		a[i]-=S;

	int ok=1;

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

		if(a[i]>0||a[i]%n) ok=0;

	puts(ok?"YES":"NO");

	return 0;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.288084416720759x):
#include<cstdio>

int n,a[100001];

long long S,T;

int main(){

	scanf("%d",&n);

	if(n==1) return 0*puts("YES");

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

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

		scanf("%d",a+i), S+=a[i];

	if(S%T) return 0*puts("NO");

	S/=T;

	a[0]=a[n];

	for(int i=n;i>=1;--i)

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

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

		a[i]-=S;

	int ok=1;

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

		if(a[i]>0||a[i]%n) ok=0;

	puts(ok?"YES":"NO");

	return 0;

}
// Slower C++ solution:
// 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"; 

}


// Faster C++ solution for the same problem (measured speedup: 5.374571785133978x):
#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;

}
// Slower C++ solution:
#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";

	}

}


// Faster C++ solution for the same problem (measured speedup: 5.453496299096337x):
#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;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.375381784399293x):
#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;

}
// Slower C++ solution:
#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");

}

// Faster C++ solution for the same problem (measured speedup: 5.278287021606953x):
#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;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.430267353861166x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.234892415142318x):
#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");

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.205075171734138x):
#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;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.232761442134975x):
#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;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.257537355504422x):
#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;

}