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

using namespace std;



typedef long long ll;

#define mp make_pair

#define pb push_back

#define pi pair<ll,ll>

#define ff first

#define ss second

#define MAX 100005

const ll MOD = 1000000007;



int main(){

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



	int t=1;

//	cin>>t;

	while(t--){

		int n;

		cin>>n;

		

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

		{

			for(int j=1;j<=9;j++)

			{

				if(i*j==n)

			    {

			    	cout<<"Yes\n";

			    	return 0;

				}

			}

		}

		cout<<"No\n";

	 

	}		

}

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

int main(){

	int a, b, temp=0;

	scanf("%d", &a);

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

		for(int j=1; j<=9; j++){

			if(i*j==a){

				temp=1;

				break;

			}

		}

	}

	if(temp == 1){

        puts("Yes");

    }

	else{

        puts("No");	

    }

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
///in the name of ALLAH

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()

{

  //  ll p=100;

    //while(p--){

    ll t;

    cin>>t;

    bool f=0;

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

    {

        if(t%i==0)

        {

            if(t/i>=1 && t/i<=9)

            {

                f=1;break;

            }

        }

    }

    if(f==1)

        cout<<"Yes"<<endl;

    else

        cout<<"No"<<endl;

}








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

int main(){

	int a, b, temp=0;

	scanf("%d", &a);

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

		for(int j=1; j<=9; j++){

			if(i*j==a){

				temp=1;

				break;

			}

		}

	}

	if(temp == 1){

        puts("Yes");

    }

	else{

        puts("No");	

    }

	return 0;

}

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

using namespace std;

#define ll long long



int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    int n;

    cin>>n;

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

        for(int j = 1; j <= 9; j++){

            if(i*j == n){

                cout<<"Yes"<<endl;

                return 0;

            }

        }

    }

    cout<<"No"<<endl;



    return 0;

}

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

int main(){

	int a, b, temp=0;

	scanf("%d", &a);

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

		for(int j=1; j<=9; j++){

			if(i*j==a){

				temp=1;

				break;

			}

		}

	}

	if(temp == 1){

        puts("Yes");

    }

	else{

        puts("No");	

    }

	return 0;

}

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

using namespace std;

int main(){

int n;

cin>>n;

bool flag = 0;



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

    int div;

    if(n%i==0){

        div = n/i;

        if(div>=1 && div<=9)

            flag = 1;

    }

}



if(flag) cout<<"Yes"<<endl;

else cout<<"No"<<endl;



}


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

int main(){

	int a, b, temp=0;

	scanf("%d", &a);

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

		for(int j=1; j<=9; j++){

			if(i*j==a){

				temp=1;

				break;

			}

		}

	}

	if(temp == 1){

        puts("Yes");

    }

	else{

        puts("No");	

    }

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
///Bismillahir Rahmanir Rahim

#include<bits/stdc++.h>

using namespace std;

#define     FAST        ios_base::sync_with_stdio(false);cin.tie(NULL)

#define     int 	    long long

#define 	pb 	        push_back

#define 	mp 	        make_pair

#define 	pi 	        2*acos(0.0)

#define     scan(i)     scanf("%lld",&i)

#define     scann(i,j)  scanf("%lld%lld",&i,&j)

#define     print(i)    printf("%lld\n",i)

#define     printt(i,j) printf("%lld %lld\n",i,j)

#define     loop(i,n) 	for(int i = 0 ; i <n ; i++)

#define     loopp(i,n) 	for(int i = 1 ; i <=n ; i++)

#define 	vect 	    vector<int>

#define 	vec_it 	    vector<int>::reverse_iterator vi

#define     sorta(v)    sort(v.begin(),v.end())

#define     sortd(v)    sort(v.begin(),v.end(),greater<>())

#define     sorted      is_sorted(v.begin(),v.end())

#define 	mapp 	    map<char,int>

#define 	pairr 	    pair<int,int>

#define 	sett	    set<int>

#define 	set_it 	    set<int>::reverse_iterator si

#define     map_it      map<char,int> :: reverse_iterator mi

#define 	yes 	    cout<<"Yes"<<endl

#define 	no 	        cout<<"No"<<endl

#define 	ff 	        first

#define 	ss 	        second

#define     mx          INT_MAX

#define     lmx         LLONG_MAX

#define     mn          INT_MIN

#define     lmn         LLONG_MIN

#define     GCD         __gcd(a,b)

#define     LCM         (a/GCD)*b

template <typename T> T gcd(T a,T b){return (b==0)?a:gcd(b,a%b);}

template <typename T> T lcm(T a,T b) {return a*(b/gcd(a,b));}

int modulo (int a, int b) { return a >= 0 ? a % b : ( b - abs ( a%b ) ) % b; }



void solve()

{

  //  freopen ("(input).txt" , "r",  stdin) ;

  //  string st,stt ;

  //  int low=0,high=0;

  //  int l=0,r;

    int n,k,t,x,y,z,d=0,temp=0,cnt=0,sum=0,f=0;

    cin>>n  ; vect v ,a ,b  ; sett s ; set_it ; mapp m,mm ;  map_it ; pairr p ;

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

    {

        if(n%i==0&&i<10&&(n/i)<10)

            temp=1;

    }

    if(temp&1)

        yes;

    else

        no;



}



main()

{

    int t;

  //  cin>>t;

  //  while(t--)

        solve();

}




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

int main(){

	int a, b, temp=0;

	scanf("%d", &a);

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

		for(int j=1; j<=9; j++){

			if(i*j==a){

				temp=1;

				break;

			}

		}

	}

	if(temp == 1){

        puts("Yes");

    }

	else{

        puts("No");	

    }

	return 0;

}

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

using namespace std;

int main()

{

    long long int sum=0,i,j,n,p,x1=0,flag=0;

    cin>>n;

    p=sqrt(n);

    for(i=1; i<=p; i++)

    {

        if(n%i==0 && i<10 && (n/i)<10)

        {

            flag=1;

            break;

        }

    }

    if(flag==1)

    {

        cout<<"Yes";

    }

    else

        cout<<"No";

    }


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

int main(){

	int a, b, temp=0;

	scanf("%d", &a);

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

		for(int j=1; j<=9; j++){

			if(i*j==a){

				temp=1;

				break;

			}

		}

	}

	if(temp == 1){

        puts("Yes");

    }

	else{

        puts("No");	

    }

	return 0;

}

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

using namespace std;

int main()

{

   int n;

cin>>n;

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

{

for(int j =1;j<=9;j++)

{

if(i*j==n){

cout<<"Yes"<<endl;

return 0;}

}

}

cout<<"No"<<endl;

}

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

int main(){

	int a, b, temp=0;

	scanf("%d", &a);

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

		for(int j=1; j<=9; j++){

			if(i*j==a){

				temp=1;

				break;

			}

		}

	}

	if(temp == 1){

        puts("Yes");

    }

	else{

        puts("No");	

    }

	return 0;

}

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

using namespace std;

int main()

{

    long long int n,m,s,c=0,i;

    cin>>n;

    for(i=1;i<10;i++){

        if(n%i==0)

        m=n/i;

        if(m>=1 && m<=9){

            cout<<"Yes\n";

            return 0;

        }

    }

    cout<<"No\n";

    return 0;

}


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

int main(){

	int a, b, temp=0;

	scanf("%d", &a);

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

		for(int j=1; j<=9; j++){

			if(i*j==a){

				temp=1;

				break;

			}

		}

	}

	if(temp == 1){

        puts("Yes");

    }

	else{

        puts("No");	

    }

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
///Bismillahir Rahmanir Rahim

#include "bits/stdc++.h"



#define                           ll                          long long

#define                           int                         ll

#define                           fi                          first

#define                           si                          second

#define                           mp                          make_pair

#define                           pb                          push_back

#define                           pi                          pair<ll,ll>

#define                           clr(x)                      memset(x,0,sizeof(x));

#define                           f(i,l,r)                    for(int i=l;i<=r;i++)

#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)

#define                           done(i)                     cout<<"done = "<<i<<endl;

#define                           show(x,y)                   cout<<x<<" : ";for(auto z:y)cout<<z<<" ";cout<<endl;

#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);



using namespace std;



const ll inf=1e18;

const int mod=1e9+7;

const int M=100005;



 main()



{

    fast

    int n;

    cin>>n;

    f(i,1,9)

    {

        f(j,1,9)

        {

            if(i*j==n)

            {

                cout<<"Yes"<<endl;

                return  0;

            }

        }

    }

    cout<<"No"<<endl;

    return 0;



}








































































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

#include<math.h>



int main(){

	int a;

	scanf("%d", &a);

	

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

		for(int j = 1; j <= 9; j++){

			if(i * j == a){

				printf("Yes\n");

				return 0;

			}

		}

	}

	printf("No\n");

	return 0;

}

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

using namespace std;

int main()

{

    long long n,i,j,a,b;

    cin>>n;

    for(i=1;i<=9;i++)

    {

        for(j=1;j<=9;j++)

        {

            if(i*j==n)

            {

                cout<<"Yes"<<endl;

                return 0;

            }

        }

    }

    cout<<"No"<<endl;

    return 0;

}


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

#include<math.h>



int main(){

	int a;

	scanf("%d", &a);

	

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

		for(int j = 1; j <= 9; j++){

			if(i * j == a){

				printf("Yes\n");

				return 0;

			}

		}

	}

	printf("No\n");

	return 0;

}

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

using namespace std;



int main()

{

    int n, chk = 0;

    cin >> n;

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

        for(int j = 0; j < 10; j++){

            if(i*j == n){

                chk = 1;

            }

        }

    }

    if(chk == 1)

        cout << "Yes";

    else

        cout << "No";



    return 0;

}


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

#include<math.h>



int main(){

	int a;

	scanf("%d", &a);

	

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

		for(int j = 1; j <= 9; j++){

			if(i * j == a){

				printf("Yes\n");

				return 0;

			}

		}

	}

	printf("No\n");

	return 0;

}

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

#define ll long long

using namespace std;

int main()

{

    int n,f = 0;

    cin>>n;

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

    {

        if(n % i == 0)

        {

            int d = n/i;

            if(i < 10 && d < 10){f = 1; break;}

        }

    }

    if(f)cout<<"Yes"<<endl;

    else cout<<"No"<<endl;

}


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

#include<math.h>



int main(){

	int a;

	scanf("%d", &a);

	

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

		for(int j = 1; j <= 9; j++){

			if(i * j == a){

				printf("Yes\n");

				return 0;

			}

		}

	}

	printf("No\n");

	return 0;

}

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

using namespace std;



int main() {

	int n;

		int count=0;

	cin>>n;

	if(n>81){

	    cout<<"No"<<endl;

	}

	else if(n<1){

	    cout<<"No"<<endl;

	}



	else {

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

	        if(n%i==0){

	            if(n/i<=9&n/i>=1){

	                cout<<"Yes";

	                count=1;

	                break;

	            }

	        }

	       }

	       if(count==0)

	       cout<<"No";

	    

	}

	return 0;

}

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

#include<math.h>



int main(){

	int a;

	scanf("%d", &a);

	

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

		for(int j = 1; j <= 9; j++){

			if(i * j == a){

				printf("Yes\n");

				return 0;

			}

		}

	}

	printf("No\n");

	return 0;

}

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

using namespace std;

int main(){

    int i = 1,x;

    while(true){

        cin >> x;

        if(x == 0) break;

        cout << "Case " << i << ": " << x <<endl;

        i++;

    }

    return 0;

}

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

#define MAX 10000



int main(){

    

    int x;

    

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

        scanf("%d",&x);

        if(x==0)

            break;

        printf("Case %d: %d\n",i,x);

    }

    return 0;

}

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

using namespace std;



int main()

{

    int x, i = 1;



    while (cin >> x) {

        if (x == 0)

            break;

        cout << "Case " << i++ << ": " << x << endl;

    }



    return 0;

}

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

#include <utility>

using namespace std;



#define _gp(l) const auto gcu{getchar##l}; const auto pcu{putchar##l}

#ifdef __linux

_gp(_unlocked);

#else

_gp();

#endif

#define _DEF(r, n, ...) inline r n(__VA_ARGS__) noexcept

#define _T template <typename T>

#define _HT template <typename H,typename... T>

#define _OP(t) inline operator t()

struct _in {

#ifdef _GLIBCXX_STRING

	_OP(string){string s;for(char c;c=gcu(),c!=' '&&c!='\n';)s+=c;return s;}

#endif

	_OP(char){char c=gcu();gcu();return c;}

	_OP(double){double d; scanf("%lf",&d); gcu();return d;}

	_T _OP(T){T n{},m{1},c;if((c=gcu())=='-')m=-1,c=gcu();do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m*n;}

} in;

#define _SCAN(...) _DEF(bool,scan,__VA_ARGS__)

_T _SCAN(T &o) {int c{gcu()};return c==EOF?false:ungetc(c,stdin),o=in,true;}

_HT _SCAN(H &h,T&&... t){return scan(h)&&scan(t...);}

#define _OUT(...) _DEF(void,out,__VA_ARGS__)

#define _OUTL(...) _DEF(void,outl,__VA_ARGS__)

_OUT(bool b){pcu('0'+b);} _OUT(const char *s){while(*s)pcu(*s++);} _OUT(char c){pcu(c);}

#ifdef _GLIBCXX_STRING

_OUT(string s){for(char c:s)pcu(c);}

#endif

_T _OUT(T n){static char b[20];char *p=b;T m=n<0?pcu('-'),-1:1;

	if(!n)*p++='0';else while(n)*p++=(char)(n%10*m+'0'),n/=10;while(p!=b)pcu(*--p);}

_OUTL(){out('\n');}

#ifdef _GLIBCXX_VECTOR

_T _OUT(vector<T> v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);}

#endif

_HT _OUT(H&& h, T&&... t){out(h);out(move(t)...);}

template <typename... T> _OUTL(T&&... t){out(move(t)...);outl();}

struct range{

	int e,b=0,s=1; range(int _b,int _e,int _s):e(_e),b(_b),s(_s){} range(int _b,int _e): e(_e), b(_b){} range(int _e):e(_e){}

	struct it { int v, s; it (int _v, int _s) : v(_v), s(_s) {} operator int()const{return v;} operator int&(){return v;} int operator*()const{return v;}

		it& operator++(){v+=s;return *this;} }; it begin() {return {b, s};} it end() {return {e, s};}};



int main() {

	for (int n, i {1}; (n = in); i++)

		outl("Case ", i, ": ", n);

}


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

using namespace std;



int main(){



	int x;



	cin >> x;



	for (int i = 1; x != 0; i++){

		cout << "Case " << i << ": " << x << endl;

		cin >> x;

	}



	return 0;

}

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



int main(){

	

	int x;



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



		scanf("%d", &x);



		if (x == 0) return 0;



		printf("Case %d: %d\n", i, x);

	}



	return 0;

}

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

#include <string>

#include <algorithm>

#include <cmath>

#include <cstdlib>

#include <vector>



using namespace std;

#define rep(i, s, e) for (int(i) = (s); (i) < (e); (i)++)



int main()

{

	int a, b, c, x, y, cost, ans;

	cin >> a >> b >> c >> x >> y;

	ans = a*x + b*y;

	rep(i, 0, 100001)

	{

		cost = c * i * 2 + a * max(0, x - i) + b * max(0, y - i);

		ans = min(ans, cost);

	}

	cout << ans << endl;

}


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

#include <string>

#include <algorithm>

#include <cmath>

#include <cstdlib>

#include <vector>

#include <map>

#include <queue> 

#include <stack>

#include <set>

#include <list>



using namespace std;

typedef long long ll;

#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))

#define all(x) x.begin(),x.end()





int main()

{

   ll a,b,c,x,y;

    cin>>a>>b>>c>>x>>y;

    ll z=max(x,y);

    ll res = 1e18;

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

    	ll tmp = c*i*2 + max(0LL,(x-i)*a)+max(0LL, (y-i)*b);

    	res=min(res,tmp);

    }

    cout<<res<<endl;

}

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

#include<algorithm>

#include<math.h>

#include<vector>

#include<map>

#include<set>



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

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



using namespace std;

using ll = long long;

using ull = unsigned long long;



int main() {

    int A; cin >> A;

    int B; cin >> B;

    int C; cin >> C;

    int X; cin >> X;

    int Y; cin >> Y;



    int min_price = 1 << 30;

    rrep(i, 0, 100000) {

        int price = 2 * C * i; // ABピザは2枚で2C円の1セットと考える

        int a = X - i; // A ピザの枚数

        int b = Y - i; // A ピザの枚数

        if (a > 0) price += A * a; // A ピザが足りなければ買い足す

        if (b > 0) price += B * b; // B ピザが足りなければ買い足す

        min_price = min(min_price, price);

    }



    cout << min_price << endl;

    return 0;

}


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

#include<algorithm>

#include<math.h>

#include<vector>

#include<map>

#include<set>



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

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



using namespace std;

using ll = long long;

using ull = unsigned long long;



int main() {

    int A; cin >> A;

    int B; cin >> B;

    int C; cin >> C;

    int X; cin >> X;

    int Y; cin >> Y;



    int min_price = 1 << 30;

    rrep(i, 0, max(X, Y)) {

        int price = 2 * C * i + max(0, A * (X - i)) + max(0, B * (Y - i));

        min_price = min(min_price, price);

    }



    cout << min_price << endl;

    return 0;

}


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

 

using namespace std;

 

int n, p[200005], in[200005], ta, tb;

set< int > s[200005];

vector< int > x, y;

bool v[200005];

 

void go(int a) {

	v[a] = 1;

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

		if (s[a].find(i) == s[a].end()) {

			s[p[a]].insert(i);

			break;

		}

	in[p[a]]--;

	if (in[p[a]] == 0)

		go(p[a]);

}

 

int main() {

	scanf("%d", &n);

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

		scanf("%d", p + i);

		in[p[i]]++;

	}

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

		if (!in[i] && !v[i])

			go(i);

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

		if (!v[i]) {

			ta = i;

			while (1) {

				x.push_back(ta);

				if (p[ta] == i)

					break;

				ta = p[ta];

			}

			break;

		}

	for (int i = 0; y.size() < 2; i++)

		if (s[x[0]].find(i) == s[x[0]].end())

			y.push_back(i);

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

		in[0] = y[i];

		for (int j = 1; j < x.size(); j++)

			for (int k = 0; ; k++)

				if (in[j - 1] != k && s[x[j]].find(k) == s[x[j]].end()) {

					in[j] = k;

					break;

				}

		if (i == 0 && in[x.size() - 1] != y[0]) {

			printf("POSSIBLE\n");

			return 0;

		}

		if (i == 1 && in[x.size() - 1] == y[0]) {

			printf("POSSIBLE\n");

			return 0;

		}

	}

	printf("IMPOSSIBLE\n");

	return 0;

}

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

using namespace std;

const int N=2050000;

inline int rd(register int x=0,register char ch=getchar(),register int f=0){

	for(;!isdigit(ch);ch=getchar()) f=ch=='-';

	for(;isdigit(ch);ch=getchar()) x=(x<<1)+(x<<3)+ch-48;

	return f?-x:x;

}

int n,B;

int head[N],to[N<<1],nxt[N<<1],sta[N],vis[N],a[N],al[N];

vector<int> scc;



void lnk(int x,int y){

	to[++B]=y,nxt[B]=head[x],head[x]=B;

}

void dfs(int x,int prt){

	if(vis[x]){

		//printf("-> %d %d %d %d\n",x,prt,vis[x],sta[0]);

		for(int i=vis[x];i<=sta[0];++i) scc.push_back(sta[i]);

		return;

	}

	sta[++sta[0]]=x,vis[x]=sta[0];

	for(int i=head[x];i;i=nxt[i]) if(to[i]!=prt) dfs(to[i],x);

	vis[x]=0;--sta[0];

}

void DFS(int x,int prt){

	for(int i=head[x];i;i=nxt[i]) if(to[i]!=prt&&!vis[to[i]]) DFS(to[i],x);

	for(int i=head[x];i;i=nxt[i]) if(to[i]!=prt&&!vis[to[i]]) al[a[to[i]]]=1;

	while(al[a[x]]) ++a[x];

	for(int i=head[x];i;i=nxt[i]) if(to[i]!=prt&&!vis[to[i]]) al[a[to[i]]]=0;

}

int main(){

	n=rd();

	for(int i=1;i<=n;++i) lnk(rd(),i);

	for(int i=1;i<=n;++i) if(!scc.size()) dfs(i,0);

	for(auto x:scc) vis[x]=1;

	for(auto x:scc) DFS(x,0);

	int mx=-n-100,mn=n+100;

	for(auto x:scc) mx=max(mx,a[x]),mn=min(mn,a[x]);

	puts((mx==mn&&scc.size()%2!=0)?"IMPOSSIBLE":"POSSIBLE");

}

// Fastest known solution for this problem: