#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll lcm(ll a, ll b) {
  return (a * b) / __gcd(a, b);
}

int main() {
  ll n, k;
  cin >> n >> k;
  ll mmc = 1;
  while (n--) {
    ll a;
    cin >> a;

    mmc = lcm(__gcd(k, a), mmc);
    mmc = __gcd(mmc, k);
  }
  cout << (__gcd(mmc, k) == k ? "Yes" : "No") << endl;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

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

ll lcm(ll a, ll b) {
  return (a * b) / gcd(a, b);
}

int main() {
  ll n, k;
  cin >> n >> k;
  ll mmc = 1;
  while (n--) {
    ll a;
    cin >> a;

    mmc = lcm(gcd(k, a), mmc);
    mmc = gcd(mmc, k);
  }
  cout << (gcd(mmc, k) == k ? "Yes" : "No") << endl;
}


#include <bits/stdc++.h>

using namespace std;

long long lcm(long long a, long long b){
    return (a*b) / __gcd(a,b);
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, k;

    cin >> n >> k;

    vector<int> lista(n);

    for(int i=0; i<n; i++){
        cin >> lista[i];
    }

    long long aux = __gcd(lista[0],k);

    for(int i=1; i<n; i++){
        aux = lcm(__gcd(lista[i], k), aux);
    }

    if(aux % k == 0){
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;

}


#include <bits/stdc++.h>

using namespace std;

int lcm(int a, int b){
    return (a*b) / __gcd(a,b);
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, k;

    cin >> n >> k;

    vector<int> lista(n);

    for(int i=0; i<n; i++){
        cin >> lista[i];
    }

    int aux = __gcd(lista[0],k);

    for(int i=1; i<n; i++){
        aux = lcm(__gcd(lista[i], k), aux);
    }

    if(aux % k == 0){
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;

}


#include <bits/stdc++.h>

using namespace std;

int lcm(int a, int b){
    return (a*b) / __gcd(a,b);
}

int main(){

    int n, k;

    cin >> n >> k;

    vector<int> lista(n);

    for(int i=0; i<n; i++){
        cin >> lista[i];
    }

    int aux = lista[0];

    for(int i=0; i<n; i++){
        aux = lcm(__gcd(lista[i], k), aux);
    }

    if(aux % k == 0){
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;

}


#include <bits/stdc++.h>

using namespace std;

int lcm(int a, int b){
    return (a*b) / __gcd(a,b);
}

int main(){

    int n, k;

    cin >> n >> k;

    vector<int> lista(n);

    for(int i=0; i<n; i++){
        cin >> lista[i];
    }

    int aux = __gcd(lista[0],k);

    for(int i=1; i<n; i++){
        aux = lcm(__gcd(lista[i], k), aux);
    }

    if(aux % k == 0){
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;

}


#include <bits/stdc++.h>

using namespace std;

int lcm(int a, int b){
    return (a*b) / __gcd(a,b);
}

int main(){

    int n, k;

    cin >> n >> k;

    int aux;
    int temp;

    cin >> temp;
    aux = temp;

    aux = lcm(__gcd(temp, k), aux);

    for(int i=0; i<n-1; i++){
        cin >> temp;

        aux = lcm(__gcd(temp, k), aux);
    }

    if(aux % k == 0){
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;

}


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

long long gcd(long long a,long long b)
{
	if(b==0)return a;
	else return gcd(b,a%b);
}
long long lcm(long long a,long long b)
{
	return (a*b)/__gcd(a,b);
}
int main()
{
	int n,k;
	scanf("%d%d",&n,&k);
	long long a,cur=1;
	for(int i=0;i<n;i++)
	{
		scanf("%d",&a);
		cur=__gcd(k,lcm(cur,a));
	}
	if(cur==k) printf("Yes");
	else printf("No");
}


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

long long lcm(long long a,long long b)
{
	return (a*b)/__gcd(a,b);
}
int main()
{
    int n,k;
	scanf("%d%d",&n,&k);
	long long a,cur=1;
	for(int i=0;i<n;i++)
	{
		scanf("%d",&a);
		cur=__gcd(k,lcm(cur,a));
	}
	if(cur==k) printf("Yes");
	else printf("No");
}


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

long long lcm(long long a,long long b)
{
	return (a*b)/__gcd(a,b);
}
int main()
{
    long long n,k;
	scanf("%d%d",&n,&k);
	long long a,cur=1;
	for(int i=0;i<n;i++)
	{
		scanf("%d",&a);
		cur=__gcd(k,lcm(cur,a));
	}
	if(cur==k) printf("Yes");
	else printf("No");
}


#include<bits/stdc++.h>
using namespace std;
long long gcd(long long  a,long long  b)
{
    return (b)?gcd(b,a%b):a;
}
long long lcm(long long a,long long b)
{
	return (a*b)/gcd(a,b);
}
int main()
{
    int  n,k;
	scanf("%d%d",&n,&k);
	long long a,cur=1;
	for(int i=0;i<n;i++)
	{
	    //cout<<"ok"<<endl;
	    scanf("%lld",&a);
		cur=gcd(k,lcm(cur,a));
	}
//	cout<<cur<<endl;
	if(cur==k) printf("Yes");
	else printf("No");
}


#include<iostream>
using namespace std;

long long gcd(long long a,long long b)
{
	if(b==0)return a;
	else return gcd(b,a%b);
}
long long lcm(long long a,long long b)
{
	return (a*b)/gcd(a,b);
}
int main()
{
    int n,k;
	scanf("%d%d",&n,&k);
	long long a,cur=1;
	for(int i=0;i<n;i++)
	{
		cin>>a;
		cur=gcd(k,lcm(cur,a));
	}
	if(cur==k) cout<<"Yes";
	else cout<<"No";
}


#include<bits/stdc++.h>
using namespace std;
long long gcd(int a,int b)
{
    return __gcd(a,b);
}
long long lcm(long long a,long long b)
{
	return (a*b)/gcd(a,b);
}
int main()
{
    int  n,k;
	scanf("%d%d",&n,&k);
	long long a,cur=1;
	for(int i=0;i<n;i++)
	{
	    //cout<<"ok"<<endl;
	    scanf("%d",&a);
		cur=gcd(k,lcm(cur,a));
	}
//	cout<<cur<<endl;
	if(cur==k) printf("Yes");
	else printf("No");
}


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

#define fi first
#define se second
#define pb push_back
#define mod(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,a,b) for(int i = a; i < b; i++)
#define forr(i,a,b) for(int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

const int maxn = 1000000+10;
int N,K,A[maxn];

bool bs[maxn];
ll sp[maxn];
void sieve(){
        for(int i = 2; i < maxn; i += 2)sp[i] = 2;//even numbers have smallest prime factor 2
        for(ll i = 3; i < maxn; i += 2){
                if(!bs[i]){
                        sp[i] = i;
                        for(ll j = i; (j*i) < maxn; j += 2){
                                if(!bs[j*i])bs[j*i] = true, sp[j*i] = i;
                        }
                }
        }
}
unordered_map<int,int> primeFactors(ll x){
	unordered_map<int,int> m;
        while(x != 1){
		m[sp[x]]++;
                x = x/sp[x];
        }
	return m;
}
int main(){
	sieve();
	scanf("%d %d",&N,&K);
	unordered_map<int,int> lcm;
	forn(i,0,N){
		cin >> A[i];
		unordered_map<int,int> primes = primeFactors(A[i]);
		for(auto &x : primes){
			if(lcm.find(x.fi) == lcm.end())lcm[x.fi] = x.se;
			else lcm[x.fi] = max(lcm[x.fi],x.se);
		}
	}
	unordered_map<int,int> k = primeFactors(K);
	for(auto &x : k){
		if(x.se > lcm[x.fi]){
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
	return 0;
}
/*
__builtin_mul_overflow(x,y,&x)
-fsplit-stack
*/


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

#define fi first
#define se second
#define pb push_back
#define mod(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,a,b) for(int i = a; i < b; i++)
#define forr(i,a,b) for(int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

const int maxn = 1000000+10;
int N,K,A[maxn];
bool bs[maxn];
ll sp[maxn];
int lcm2[maxn];

void sieve(){
        for(int i = 2; i < maxn; i += 2)sp[i] = 2;//even numbers have smallest prime factor 2
        for(ll i = 3; i < maxn; i += 2){
                if(!bs[i]){
                        sp[i] = i;
                        for(ll j = i; (j*i) < maxn; j += 2){
                                if(!bs[j*i])bs[j*i] = true, sp[j*i] = i;
                        }
                }
        }
}
void primeFactors(ll x){
	int ant = -1;
	int cnt = 0;
	//cout << x << ":D\n";
        while(x != 1){
		if(ant != sp[x]){
			if(ant != -1){
				lcm2[ant] = max(lcm2[ant],cnt);
				//cout << ant << ' ' << cnt << '\n';
			}
			ant = sp[x];
			cnt = 1;
		}else{
			cnt++;
		}
                x = x/sp[x];
        }
	if(ant != -1){
		lcm2[ant] = max(lcm2[ant],cnt);
		//cout << ant << ' ' << cnt << '\n';
	}
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	sieve();
	cin >> N >> K;
	forn(i,0,N){
		cin >> A[i];
		primeFactors(A[i]);
	}
	int ant = -1;
	int cnt = 0;
	bool can = true;
	while(K != 1){
                if(ant != sp[K]){
                        if(ant != -1){
				if(lcm2[ant] < cnt)can = false;
                        }
                        ant = sp[K];
                        cnt = 1;
                }else{
                        cnt++;
                }
                K = K/sp[K];
        }
        if(ant != -1){
		if(lcm2[ant] < cnt)can = false;
        }
	if(can)cout << "Yes\n";
	else cout << "No\n";
	return 0;
}
/*
__builtin_mul_overflow(x,y,&x)
-fsplit-stack
*/


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

#define fi first
#define se second
#define pb push_back
#define mod(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,a,b) for(int i = a; i < b; i++)
#define forr(i,a,b) for(int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

const int maxn = 1000000+10;
int N,K,A[maxn];

bool bs[maxn];
ll sp[maxn];
void sieve(){
        for(int i = 2; i < maxn; i += 2)sp[i] = 2;//even numbers have smallest prime factor 2
        for(ll i = 3; i < maxn; i += 2){
                if(!bs[i]){
                        sp[i] = i;
                        for(ll j = i; (j*i) < maxn; j += 2){
                                if(!bs[j*i])bs[j*i] = true, sp[j*i] = i;
                        }
                }
        }
}
unordered_map<int,int> primeFactors(ll x){
	unordered_map<int,int> m;
        while(x != 1){
		m[sp[x]]++;
                x = x/sp[x];
        }
	return m;
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	sieve();
	cin >> N >> K;
	unordered_map<int,int> lcm;
	forn(i,0,N){
		cin >> A[i];
		unordered_map<int,int> primes = primeFactors(A[i]);
		for(auto &x : primes){
			if(lcm.find(x.fi) == lcm.end())lcm[x.fi] = x.se;
			else lcm[x.fi] = max(lcm[x.fi],x.se);
		}
	}
	unordered_map<int,int> k = primeFactors(K);
	for(auto &x : k){
		if(x.se > lcm[x.fi]){
			cout << "No\n";
			return 0;
		}
	}
	cout << "Yes\n";
	return 0;
}
/*
__builtin_mul_overflow(x,y,&x)
-fsplit-stack
*/


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

#define fi first
#define se second
#define pb push_back
#define mod(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,a,b) for(int i = a; i < b; i++)
#define forr(i,a,b) for(int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

const int maxn = 1000000+10;
int N,K,A[maxn];
bool bs[maxn];
ll sp[maxn];
int lcm[maxn];

void sieve(){
        for(int i = 2; i < maxn; i += 2)sp[i] = 2;//even numbers have smallest prime factor 2
        for(ll i = 3; i < maxn; i += 2){
                if(!bs[i]){
                        sp[i] = i;
                        for(ll j = i; (j*i) < maxn; j += 2){
                                if(!bs[j*i])bs[j*i] = true, sp[j*i] = i;
                        }
                }
        }
}
void primeFactors(ll x){
	int ant = -1;
	int cnt = 0;
	//cout << x << ":D\n";
        while(x != 1){
		if(ant != sp[x]){
			if(ant != -1){
				lcm[ant] = max(lcm[ant],cnt);
				//cout << ant << ' ' << cnt << '\n';
			}
			ant = sp[x];
			cnt = 1;
		}else{
			cnt++;
		}
                x = x/sp[x];
        }
	if(ant != -1){
		lcm[ant] = max(lcm[ant],cnt);
		//cout << ant << ' ' << cnt << '\n';
	}
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	sieve();
	cin >> N >> K;
	forn(i,0,N){
		cin >> A[i];
		primeFactors(A[i]);
	}
	int ant = -1;
	int cnt = 0;
	bool can = true;
	while(K != 1){
                if(ant != sp[K]){
                        if(ant != -1){
				if(lcm[ant] < cnt)can = false;
                        }
                        ant = sp[K];
                        cnt = 1;
                }else{
                        cnt++;
                }
                K = K/sp[K];
        }
        if(ant != -1){
		if(lcm[ant] < cnt)can = false;
        }
	if(can)cout << "Yes\n";
	else cout << "No\n";
	return 0;
}
/*
__builtin_mul_overflow(x,y,&x)
-fsplit-stack
*/


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

#define fi first
#define se second
#define pb push_back
#define mod(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,a,b) for(int i = a; i < b; i++)
#define forr(i,a,b) for(int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

const int maxn = 1000000+10;
int N,K,A[maxn];

ll _sieve_size;
bitset<10000010> bs;
vi primes;

void sieve(ll upperbound){
        _sieve_size = upperbound+1;
        bs.set();
        bs[0] = bs[1] = 0;
        for(ll i = 2; i <= _sieve_size; i++){
                if(bs[i]){
                        for(ll j = i*i; j <= _sieve_size; j += i) bs[j] = 0;
                        primes.push_back(i);
                }
        }
}
map<int,int> primeFactors(ll n){
        ll pf_idx = 0, pf = primes[pf_idx];
	map<int,int> factors;
        while(pf*pf <= n){
                while(n%pf == 0){ n /= pf; factors[pf]++;}
                pf = primes[++pf_idx];
        }
        if(n != 1){
		factors[n]++;
        }
        //return ans Number of prime factors of n
        return factors;
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	sieve(1000000);
	cin >> N >> K;
	map<int,int> lcm;
	forn(i,0,N){
		cin >> A[i];
		map<int,int> primes = primeFactors(A[i]);
		for(auto &x : primes){
			if(lcm.find(x.fi) == lcm.end())lcm[x.fi] = x.se;
			else lcm[x.fi] = max(lcm[x.fi],x.se);
		}
	}
	map<int,int> k = primeFactors(K);
	for(auto &x : k){
		if(x.se > lcm[x.fi]){
			cout << "No\n";
			return 0;
		}
	}
	cout << "Yes\n";
	return 0;
}
/*
__builtin_mul_overflow(x,y,&x)
-fsplit-stack
*/


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

#define fi first
#define se second
#define pb push_back
#define mod(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,a,b) for(int i = a; i < b; i++)
#define forr(i,a,b) for(int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

const int maxn = 1000000+10;
int N,K,A[maxn];

ll _sieve_size;
bitset<10000010> bs;
vi primes;

void sieve(ll upperbound){
        _sieve_size = upperbound+1;
        bs.set();
        bs[0] = bs[1] = 0;
        for(ll i = 2; i <= _sieve_size; i++){
                if(bs[i]){
                        for(ll j = i*i; j <= _sieve_size; j += i) bs[j] = 0;
                        primes.push_back(i);
                }
        }
}
unordered_map<int,int> primeFactors(ll n){
        ll pf_idx = 0, pf = primes[pf_idx];
	unordered_map<int,int> factors;
        while(pf*pf <= n){
                while(n%pf == 0){ n /= pf; factors[pf]++;}
                pf = primes[++pf_idx];
        }
        if(n != 1){
		factors[n]++;
        }
        //return ans Number of prime factors of n
        return factors;
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	sieve(1000000);
	cin >> N >> K;
	unordered_map<int,int> lcm;
	forn(i,0,N){
		cin >> A[i];
		unordered_map<int,int> primes = primeFactors(A[i]);
		for(auto &x : primes){
			if(lcm.find(x.fi) == lcm.end())lcm[x.fi] = x.se;
			else lcm[x.fi] = max(lcm[x.fi],x.se);
		}
	}
	unordered_map<int,int> k = primeFactors(K);
	for(auto &x : k){
		if(x.se > lcm[x.fi]){
			cout << "No\n";
			return 0;
		}
	}
	cout << "Yes\n";
	return 0;
}
/*
__builtin_mul_overflow(x,y,&x)
-fsplit-stack
*/


#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define pb push_back
#define mp make_pair
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
#define filein freopen("input.txt","r",stdin)
#define fileout freopen("output.txt","w",stdout)
using namespace std;
const ll mx=1000009;
ll x,y ;
bitset<1000009>prime;
vector<ll> v;
void sieve()
{
    for(ll i=3;i*i<=1000000;i+=2)
    {
        if(prime[i]==false)
        {
            for(ll j=i*i;j<=1000000;j+=2*i)
            {

                prime[j]=true;
            }
        }
    }
    v.pb(2);
    for(ll i=3;i<=1000000;i+=2) if(prime[i]==false ) v.pb(i);
}
ll cnt[mx];
int main()
{
    fast;
    sieve();
    ll n,k;
    cin>>n>>k;
    for(ll i=0;i<n;i++)
    {
        ll x; cin>>x;
        for(ll j=0;j<(ll)v.size() and v[j]*v[j]<=x;j++)
        {

            if(x%v[j]==0)
            {
                ll c=0;
                while(x%v[j]==0) c++,x/=v[j];
                cnt[v[j]]=max(cnt[v[j]],c) ;
            }
        }
        if(x>1) cnt[x]=max(cnt[x],1LL);
    }
    vector<pair<int,int> > vv;
    for(ll j=0;j<(ll)v.size() and v[j]*v[j]<=k;j++)
    {

        if(k%v[j]==0)
        {
            ll c=0;
            while(k%v[j]==0) c++,k/=v[j];
            vv.pb(mp(v[j],c));
        }

    }
    if(k>1)
    {
        vv.pb(mp(k,1));
    }
    bool ck=0;
    for(auto x: vv)
    {
        if(cnt[x.first]>=x.second);
        else ck=1;
    }
    if(ck) cout<<"No"<<endl;
    else cout<<"Yes"<<endl;

}


#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define endl '\n'
#define pb push_back
#define mod 1000000007
#define mp make_pair
#define pi acos(-1)
#define line cout<<"----------------------------"<<endl
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
#define filein freopen("input.txt","r",stdin)
#define fileout freopen("brute.cpp","w",stdout)
using namespace std;
const ll mx=300009;
int main()
{
    fast;
    ll n,k;
    cin>>n>>k;
    vector<ll> v;
    for(ll i=0;i<n;i++)
    {
        ll x; cin>>x;
        if(k%x==0) v.pb(x);
    }
    ll lcm=1;
    for(auto x: v)
    {
        ll gcd=__gcd(lcm,x);
        lcm=lcm/gcd*x;
    }
    if(lcm==k) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define pb push_back
#define mp make_pair
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
#define filein freopen("input.txt","r",stdin)
#define fileout freopen("output.txt","w",stdout)
using namespace std;
const ll mx=1000009;
ll x,y ;
ll prime[1000009];
vector<ll> v;
void sieve()
{
    for(ll i=2;i<=1000000;i++)
    {
        if(i%2==0) prime[i]=2;
        else prime[i]=i;
    }
    for(ll i=3;i*i<=1000000;i+=2)
    {
        if(prime[i]==i)
        {
            for(ll j=i*i;j<=1000000;j+=2*i)
            {
                if(prime[j]==j) prime[j]=i;
            }
        }
    }
}
ll cnt[mx];
int main()
{
    fast;
    sieve();
    ll n,k;
    cin>>n>>k;
    for(ll i=0;i<n;i++)
    {
        ll x; cin>>x;

        while(x>1)
        {
            ll val=prime[x];
            ll c=0;
            while(x%val==0) c++,x/=val;
            cnt[val]=max(cnt[val],c);
        }
    }
    vector<pair<ll,ll> > vv;
    while(k>1)
    {
        ll val=prime[k];
        ll c=0;
        while(k%val==0) c++,k/=val;
        vv.pb(mp(val,c));
    }
    bool ck=0;
    for(auto x: vv)
    {
        if(cnt[x.first]>=x.second);
        else ck=1;
    }
    if(ck) cout<<"No"<<endl;
    else cout<<"Yes"<<endl;

}


#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define pb push_back
#define mp make_pair
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
#define filein freopen("input.txt","r",stdin)
#define fileout freopen("output.txt","w",stdout)
using namespace std;
const ll mx=1000009;
ll x,y ;
bitset<1000009>prime;
vector<ll> v;
void sieve()
{
    for(ll i=3;i*i<=1000000;i+=2)
    {
        if(prime[i]==false)
        {
            for(ll j=i*i;j<=1000000;j+=2*i)
            {

                prime[j]=true;
            }
        }
    }
    v.pb(2);
    for(ll i=3;i<=1000000;i+=2) if(prime[i]==false ) v.pb(i);
}
ll cnt[mx];
int main()
{
    sieve();
    ll n,k;
    cin>>n>>k;
    for(ll i=0;i<n;i++)
    {
        ll x; cin>>x;
        for(ll j=0;j<(ll)v.size() and v[j]*v[j]<=x;j++)
        {

            if(x%v[j]==0)
            {
                ll c=0;
                while(x%v[j]==0) c++,x/=v[j];
                cnt[v[j]]=max(cnt[v[j]],c) ;
            }
        }
        if(x>1) cnt[x]=max(cnt[x],1LL);
    }
    //for(int i=1;i<=12;i++) if(cnt[i]) cout<<i<<' '<<cnt[i]<<endl;
    for(ll j=0;j<(ll)v.size() and v[j]*v[j]<=k;j++)
    {

        if(k%v[j]==0)
        {
            ll c=0;
            while(k%v[j]==0) c++,k/=v[j];
            if(cnt[v[j]]>=c)
            {
                cout<<"Yes"<<endl;
                return 0;
            }
        }

    }
    if(k>1 and cnt[k])
    {
        cout<<"Yes"<<endl;
        return 0;
    }
    cout<<"No"<<endl;

}


#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define pb push_back
#define mp make_pair
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
#define filein freopen("input.txt","r",stdin)
#define fileout freopen("output.txt","w",stdout)
using namespace std;
const ll mx=1000009;
ll x,y ;
bitset<1000009>prime;
vector<ll> v;
void sieve()
{
    for(ll i=3;i*i<=1000000;i+=2)
    {
        if(prime[i]==false)
        {
            for(ll j=i*i;j<=1000000;j+=2*i)
            {

                prime[j]=true;
            }
        }
    }
    v.pb(2);
    for(ll i=3;i<=1000000;i+=2) if(prime[i]==false ) v.pb(i);
}
ll cnt[mx];
int main()
{
    sieve();
    ll n,k;
    cin>>n>>k;
    for(ll i=0;i<n;i++)
    {
        ll x; cin>>x;
        for(ll j=0;j<(ll)v.size() and v[j]*v[j]<=x;j++)
        {

            if(x%v[j]==0)
            {
                ll c=0;
                while(x%v[j]==0) c++,x/=v[j];
                cnt[v[j]]=max(cnt[v[j]],c) ;
            }
        }
        if(x>1) cnt[x]=max(cnt[x],1LL);
    }
    vector<pair<int,int> > vv;
    for(ll j=0;j<(ll)v.size() and v[j]*v[j]<=k;j++)
    {

        if(k%v[j]==0)
        {
            ll c=0;
            while(k%v[j]==0) c++,k/=v[j];
            vv.pb(mp(v[j],c));
        }

    }
    if(k>1)
    {
        vv.pb(mp(k,1));
    }
    bool ck=0;
    for(auto x: vv)
    {
        if(cnt[x.first]>=x.second);
        else ck=1;
    }
    if(ck) cout<<"No"<<endl;
    else cout<<"Yes"<<endl;

}


#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define endl '\n'
#define pb push_back
#define mod 1000000007
#define mp make_pair
#define pi acos(-1)
#define line cout<<"----------------------------"<<endl
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
#define filein freopen("input.txt","r",stdin)
#define fileout freopen("brute.cpp","w",stdout)
using namespace std;
const ll mx=300009;
int main()
{
    fast;
    ll n,k;
    cin>>n>>k;
    vector<ll> v;
    for(ll i=0;i<n;i++)
    {
        ll x; cin>>x;
        if(k%x==0) v.pb(x);
    }
    ll lcm=1;
    for(auto x: v)
    {
        ll gcd=__gcd(lcm,x);
        lcm=lcm/gcd*x;
    }
    if(lcm%k==0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define endl '\n'
#define pb push_back
#define mod 1000000007
#define mp make_pair
#define pi acos(-1)
#define line cout<<"----------------------------"<<endl
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
#define filein freopen("input.txt","r",stdin)
#define fileout freopen("brute.cpp","w",stdout)
using namespace std;
const ll mx=300009;
int main()
{
    fast;
    ll n,k;
    cin>>n>>k;
    vector<ll> v;
    for(ll i=0;i<n;i++)
    {
        ll x; cin>>x;
        if(k%x==0) v.pb(x);
        if(x%k==0) v.pb(x);
    }
    ll lcm=1;
    for(auto x: v)
    {
        ll gcd=__gcd(lcm,x);
        lcm=lcm/gcd*x;
    }
    if(lcm%k==0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


#include <bits/stdc++.h>

#define fi first
#define se second
#define forn(i,n) for(int i=0; i< (int)n; ++i)
#define for1(i,n) for(int i=1; i<= (int)n; ++i)
#define fore(i,l,r) for(int i=(int)l; i<= (int)r; ++i)
#define ford(i,n) for(int i=(int)(n) - 1; i>= 0; --i)
#define fored(i,l,r) for(int i=(int)r; i>= (int)l; --i)
#define pb push_back
#define el '\n'
#define d(x) cout<< #x<< " " << x<<el
#define ri(n) scanf("%d",&n)
#define sz(v) ((int)v.size())
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()

using namespace std;

typedef long long ll;
typedef double ld;
typedef pair<int,int> ii;
typedef pair<char,int> pci;
typedef tuple<int, int, int> tiii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;

const ll inf = 1e18;
const int nax = 1e5+200;
const ld pi = acos(-1);
const ld eps= 1e-9;

int dr[] = {1,-1,0, 0,1,-1,-1, 1}; // trick to explore an implicit 2D grid
int dc[] = {0, 0,1,-1,1, 1,-1,-1};

vector<int> a;
int n, k;
bool f;

bool go(int i, ll m){
  if(f) return 1;
  if(m==k) return f = 1;
  if(i==n) return 0;
  bool x = false;
  if(__gcd(m, ll(a[i]) )==1 && a[i]*m <= k && !f){
    x = go(i+1, a[i]*m);
  }
  x |= go(i+1, m);
  return x;
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  cout<< setprecision(20)<< fixed;
  cin>> n>>k;
  a.reserve(n);
  set<int> s;
  int r;
  forn(i,n){
    cin>> r;
    if(k%r==0 && !s.count(r)){
      s.insert(r);
      a.pb(r);
    }
  }
  sort(allr(a));
  n =sz(a);
  go(0, 1);
  cout<< (f ? "Yes" : "No") <<el;

}


#include <bits/stdc++.h>

#define fi first
#define se second
#define forn(i,n) for(int i=0; i< (int)n; ++i)
#define for1(i,n) for(int i=1; i<= (int)n; ++i)
#define fore(i,l,r) for(int i=(int)l; i<= (int)r; ++i)
#define ford(i,n) for(int i=(int)(n) - 1; i>= 0; --i)
#define fored(i,l,r) for(int i=(int)r; i>= (int)l; --i)
#define pb push_back
#define el '\n'
#define d(x) cout<< #x<< " " << x<<el
#define ri(n) scanf("%d",&n)
#define sz(v) ((int)v.size())
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()

using namespace std;

typedef long long ll;
typedef double ld;
typedef pair<int,int> ii;
typedef pair<char,int> pci;
typedef tuple<int, int, int> tiii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;

const ll inf = 1e18;
const int nax = 1e5+200;
const ld pi = acos(-1);
const ld eps= 1e-9;

int dr[] = {1,-1,0, 0,1,-1,-1, 1}; // trick to explore an implicit 2D grid
int dc[] = {0, 0,1,-1,1, 1,-1,-1};

vector<int> a;
int n, k;
bool f;

bool go(int i, ll m){
  if(f) return 1;
  if(m==k) return f = 1;
  if(i==n) return 0;
  bool x = false;
  if(__gcd(m, ll(a[i]) )==1 && a[i]*m <= k && !f){
    x = go(i+1, a[i]*m);
  }
  x |= go(i+1, m);
  return x;
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  cout<< setprecision(20)<< fixed;
  cin>> n>>k;
  a.reserve(n);
  set<int> s;
  int r;
  forn(i,n){
    cin>> r;
    if(r%k==0){
      f= true;
      break;
    }
    if(k%r==0 && !s.count(r)){
      s.insert(r);
      a.pb(r);
    }
  }
  sort(allr(a));
  n =sz(a);
  if(!f) go(0, 1);
  cout<< (f ? "Yes" : "No") <<el;

}


#include <bits/stdc++.h>

#define fi first
#define se second
#define forn(i,n) for(int i=0; i< (int)n; ++i)
#define for1(i,n) for(int i=1; i<= (int)n; ++i)
#define fore(i,l,r) for(int i=(int)l; i<= (int)r; ++i)
#define ford(i,n) for(int i=(int)(n) - 1; i>= 0; --i)
#define fored(i,l,r) for(int i=(int)r; i>= (int)l; --i)
#define pb push_back
#define el '\n'
#define d(x) cout<< #x<< " " << x<<el
#define ri(n) scanf("%d",&n)
#define sz(v) ((int)v.size())
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()

using namespace std;

typedef long long ll;
typedef double ld;
typedef pair<int,int> ii;
typedef pair<char,int> pci;
typedef tuple<int, int, int> tiii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;

const ll inf = 1e18;
const int nax = 1e5+200;
const ld pi = acos(-1);
const ld eps= 1e-9;

int dr[] = {1,-1,0, 0,1,-1,-1, 1}; // trick to explore an implicit 2D grid
int dc[] = {0, 0,1,-1,1, 1,-1,-1};

vector<int> a;
int n, k;
bool f;

bool go(int i, ll m){
  if(f) return 1;
  if(m%k==0) return f = 1;
  if(i==n) return 0;
  bool x = false;
  if(__gcd(m, ll(a[i]) )==1 && a[i]*m <= k && !f){
    x = go(i+1, a[i]*m);
  }
  x |= go(i+1, m);
  return x;
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  cout<< setprecision(20)<< fixed;
  cin>> n>>k;
  a.reserve(n);
  set<int> s;
  int r;
  forn(i,n){
    cin>> r;
    if(r%k==0){
      f= true;
      break;
    }
    if(k%r==0 && !s.count(r)){
      s.insert(r);
      a.pb(r);
    }
  }
  sort(allr(a));
  n =sz(a);
  if(!f) go(0, 1);
  cout<< (f ? "Yes" : "No") <<el;

}


#include <bits/stdc++.h>

#define fi first
#define se second
#define forn(i,n) for(int i=0; i< (int)n; ++i)
#define for1(i,n) for(int i=1; i<= (int)n; ++i)
#define fore(i,l,r) for(int i=(int)l; i<= (int)r; ++i)
#define ford(i,n) for(int i=(int)(n) - 1; i>= 0; --i)
#define fored(i,l,r) for(int i=(int)r; i>= (int)l; --i)
#define pb push_back
#define el '\n'
#define d(x) cout<< #x<< " " << x<<el
#define ri(n) scanf("%d",&n)
#define sz(v) ((int)v.size())
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()

using namespace std;

typedef long long ll;
typedef double ld;
typedef pair<int,int> ii;
typedef pair<char,int> pci;
typedef tuple<int, int, int> tiii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;

const ll inf = 1e18;
const int nax = 1e5+200;
const ld pi = acos(-1);
const ld eps= 1e-9;

int dr[] = {1,-1,0, 0,1,-1,-1, 1}; // trick to explore an implicit 2D grid
int dc[] = {0, 0,1,-1,1, 1,-1,-1};

vector<int> a;
int n, k;
bool f;

bool go(int i, ll m){
  if(f) return 1;
  if(m%k==0) return f = 1;
  if(i==n) return 0;
  bool x = false;
  if(__gcd(m, ll(a[i]) )==1 && !f){
    x = go(i+1, a[i]*m);
  }
  x |= go(i+1, m);
  return x;
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  cout<< setprecision(20)<< fixed;
  cin>> n>>k;
  a.reserve(n);
  set<int> s;
  int r;
  forn(i,n){
    cin>> r;
    if(r%k==0){
      f= true;
      break;
    }
    if(__gcd(k,r)!=1 && !s.count(r)){
      s.insert(r);
      a.pb(r);
    }
  }
  sort(allr(a));
  n =sz(a);
  if(!f) go(0, 1);
  cout<< (f ? "Yes" : "No") <<el;

}


#include <bits/stdc++.h>

#define fi first
#define se second
#define forn(i,n) for(int i=0; i< (int)n; ++i)
#define for1(i,n) for(int i=1; i<= (int)n; ++i)
#define fore(i,l,r) for(int i=(int)l; i<= (int)r; ++i)
#define ford(i,n) for(int i=(int)(n) - 1; i>= 0; --i)
#define fored(i,l,r) for(int i=(int)r; i>= (int)l; --i)
#define pb push_back
#define el '\n'
#define d(x) cout<< #x<< " " << x<<el
#define ri(n) scanf("%d",&n)
#define sz(v) ((int)v.size())
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()

using namespace std;

typedef long long ll;
typedef double ld;
typedef pair<int,int> ii;
typedef pair<char,int> pci;
typedef tuple<int, int, int> tiii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;

const ll inf = 1e18;
const int nax = 1e5+200;
const ld pi = acos(-1);
const ld eps= 1e-9;

int dr[] = {1,-1,0, 0,1,-1,-1, 1}; // trick to explore an implicit 2D grid
int dc[] = {0, 0,1,-1,1, 1,-1,-1};

vector<int> a;
int n; ll k;

vi solve(ll k){
  int lim = sqrt(k);
  int cant = 0;
  vi ans;
  fore(i,2,lim){
    cant = 0;
    if(k%i==0){
      while(k%i==0){
        ++cant;
        k/=i;
      }
      ans.pb(pow(i,cant));
    }
  }
  if(k!=1){
    ans.pb(k);
  }
  return ans;
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  cout<< setprecision(20)<< fixed;
  cin>> n>>k;
  vector<int> desc = solve(k);
  a.reserve(n);
  set<int> s;
  int r;
  vector<bool> seen(sz(desc));
  forn(i,n){
    cin>> r;
    forn(j,sz(desc)){
      int x = desc[j];
      if(r%x==0){
        seen[j] = true;
      }
    }
  }
  bool f = true;
  forn(i,sz(desc)){
    f&= (seen[i]);
  }
  cout<< (f ? "Yes" : "No") <<el;

}


#include <bits/stdc++.h>

#define fi first
#define se second
#define forn(i,n) for(int i=0; i< (int)n; ++i)
#define for1(i,n) for(int i=1; i<= (int)n; ++i)
#define fore(i,l,r) for(int i=(int)l; i<= (int)r; ++i)
#define ford(i,n) for(int i=(int)(n) - 1; i>= 0; --i)
#define fored(i,l,r) for(int i=(int)r; i>= (int)l; --i)
#define pb push_back
#define el '\n'
#define d(x) cout<< #x<< " " << x<<el
#define ri(n) scanf("%d",&n)
#define sz(v) ((int)v.size())
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()

using namespace std;

typedef long long ll;
typedef double ld;
typedef pair<int,int> ii;
typedef pair<char,int> pci;
typedef tuple<int, int, int> tiii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;

const ll inf = 1e18;
const int nax = 1e5+200;
const ld pi = acos(-1);
const ld eps= 1e-9;

int dr[] = {1,-1,0, 0,1,-1,-1, 1}; // trick to explore an implicit 2D grid
int dc[] = {0, 0,1,-1,1, 1,-1,-1};

vector<int> a;
int n; ll k;
bool f;

bool go(int i, ll m){
  if(f) return 1;
  if(m%k==0) return f = 1;
  if(i==n) return 0;
  bool x = false;
  ll g = k/__gcd(k,m);
  if(__gcd(m, ll(a[i]))==1 && __gcd(g,ll(a[i]) )!=1 && !f){
    x = go(i+1, a[i]*m);
  }
  x |= go(i+1, m);
  return x;
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  cout<< setprecision(20)<< fixed;
  cin>> n>>k;
  a.reserve(n);
  set<int> s;
  int r;
  forn(i,n){
    cin>> r;
    if(r%k==0){
      f= true;
      break;
    }
    if(__gcd(k,ll(r) )!=1 && !s.count(r)){
      s.insert(r);
      a.pb(r);
    }
  }
  sort(allr(a));
  n =sz(a);
  if(!f) go(0, 1);
  cout<< (f ? "Yes" : "No") <<el;

}


#include <bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define pli pair<long long,int>
#define pil pair<int,long long>
#define ll long long
#define el '\n'

using namespace std;

ll n, k;
map <ll, int> cek;

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

    cin >> n >> k;
    for (int i=0;i<n;i++){
        ll temp;
        cin >> temp;
        ll gcc = __gcd(k, temp);
        for (ll j=2;j*j<=gcc;j++){
            if (gcc%j == 0){
                while(gcc%j == 0){
                    cek[j]++;
                    gcc /= j;
                }
            }
        }
        if (gcc != 1){
            cek[gcc]++;
        }
    }

    for (auto x : cek){
        for (int i=0;i<x.se;i++){
            if (k % x.fi == 0){
                k /= x.fi;
            }
        }
    }

    if (k == 1){
        cout << "Yes" << el;
    } else{
        cout << "No" << el;
    }

    return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define pli pair<long long,int>
#define pil pair<int,long long>
#define ll long long
#define el '\n'

using namespace std;

ll n, k;
map <ll, int> cek;

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

    cin >> n >> k;
    for (int i=0;i<n;i++){
        ll temp;
        cin >> temp;
        ll gcc = __gcd(k, temp);
        for (ll j=2;j*j<=gcc;j++){
            if (gcc%j == 0){
                int cnt = 0;
                while(gcc%j == 0){
                    cnt++;
                    gcc /= j;
                }
                cek[gcc] = max(cek[gcc], cnt);
            }
        }
        if (gcc != 1){
            cek[gcc]++;
        }
    }

    for (auto x : cek){
        for (int i=0;i<x.se;i++){
            if (k % x.fi == 0){
                k /= x.fi;
            }
        }
    }

    if (k == 1){
        cout << "Yes" << el;
    } else{
        cout << "No" << el;
    }

    return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define pli pair<long long,int>
#define pil pair<int,long long>
#define ll long long
#define el '\n'

using namespace std;

ll n, k;
map <ll, int> cek;

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

    cin >> n >> k;
    for (int i=0;i<n;i++){
        ll temp;
        cin >> temp;
        ll gcc = __gcd(k, temp);
        for (ll j=2;j*j<=gcc;j++){
            if (gcc%j == 0){
                int cnt = 0;
                while(gcc%j == 0){
                    cnt++;
                    gcc /= j;
                }
                cek[j] = max(cek[j], cnt);
            }
        }
        if (gcc != 1){
            cek[gcc]++;
        }
    }

    for (auto x : cek){
        for (int i=0;i<x.se;i++){
            if (k % x.fi == 0){
                k /= x.fi;
            }
        }
    }

    if (k == 1){
        cout << "Yes" << el;
    } else{
        cout << "No" << el;
    }

    return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define pli pair<long long,int>
#define pil pair<int,long long>
#define ll long long
#define el '\n'

using namespace std;

ll n, k;
map <ll, int> cek;

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

    cin >> n >> k;
    for (int i=0;i<n;i++){
        ll temp;
        cin >> temp;
        ll gcc = __gcd(k, temp);
        for (ll j=2;j*j<=gcc;j++){
            if (gcc%j == 0){
                cnt = 0;
                while(gcc%j == 0){
                    cnt++;
                    gcc /= j;
                }
                cek[gcc] = max(cek[gcc], cnt);
            }
        }
        if (gcc != 1){
            cek[gcc]++;
        }
    }

    for (auto x : cek){
        for (int i=0;i<x.se;i++){
            if (k % x.fi == 0){
                k /= x.fi;
            }
        }
    }

    if (k == 1){
        cout << "Yes" << el;
    } else{
        cout << "No" << el;
    }

    return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define pli pair<long long,int>
#define pil pair<int,long long>
#define ll long long
#define el '\n'

using namespace std;

ll n, k;
int cek[1000003];

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

    cin >> n >> k;
    for (int i=0;i<n;i++){
        ll temp;
        cin >> temp;
        ll gcc = __gcd(k, temp);
        for (ll j=2;j*j<=gcc;j++){
            if (gcc%j == 0){
                int cnt = 0;
                while(gcc%j == 0){
                    cnt++;
                    gcc /= j;
                }
                cek[j] = max(cek[j], cnt);
            }
        }
        if (gcc != 1 && gcc){
            cek[gcc] = max(cek[gcc], 1);
        }
    }

    for (int i=2;i<=k;i++){
        for (int j=0;j<cek[i];j++){
            if (k % i == 0){
                k /= i;
            } else{
                break;
            }
        }
    }

    if (k == 1){
        cout << "Yes" << el;
    } else{
        cout << "No" << el;
    }

    return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define pli pair<long long,int>
#define pil pair<int,long long>
#define ll long long
#define el '\n'

using namespace std;

ll n, k;
ll cur = 1;

ll __lcm(ll a, ll b){
    return a * b / __gcd(a, b);
}

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

    cin >> n >> k;
    for (int i=0;i<n;i++){
        ll temp;
        cin >> temp;
        ll gcc = __gcd(k, temp);
        cur = __lcm(gcc, cur);
    }

    if (__gcd(cur, k) == k){
        cout << "Yes" << el;
    } else{
        cout << "No" << el;
    }

    return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define pli pair<long long,int>
#define pil pair<int,long long>
#define ll long long
#define el '\n'

using namespace std;

ll n, k;
map <ll, int> cek;

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

    cin >> n >> k;
    for (int i=0;i<n;i++){
        ll temp;
        cin >> temp;
        ll gcc = __gcd(k, temp);
        for (ll j=2;j*j<=gcc;j++){
            if (gcc%j == 0){
                int cnt = 0;
                while(gcc%j == 0){
                    cnt++;
                    gcc /= j;
                }
                cek[j] = max(cek[j], cnt);
            }
        }
        if (gcc != 1){
            cek[gcc] = max(cek[gcc], 1);
        }
    }

    for (auto x : cek){
        for (int i=0;i<x.se;i++){
            if (k % x.fi == 0){
                k /= x.fi;
            }
        }
    }

    if (k == 1){
        cout << "Yes" << el;
    } else{
        cout << "No" << el;
    }

    return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main() {
    long long n, k;
    cin >> n >> k;
    long long nok = 1;
    for (int i = 0; i < n; ++i) {
        long long c;
        cin >> c;
        long long tmp =  __gcd(nok, c);
        nok = nok * c / tmp;
    }
    if (nok % k == 0) {
        cout << "YES\n";
    }
    else {
        cout << "NO\n";
    }
    return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;
int const N = 1e6 + 10;
int dat[N];

int main() {
    long long n, k;
    cin >> n >> k;
    map<int, int> sueta;
    for (long long i = 2; i * i <= k; ++i) {
        if (cpk % i == 0) {
            int cnt = 0;
            while(cpk % i == 0) {
                ++cnt;
                cpk /= i;
            }
            sueta[i] = cnt;
        }
    }
    if (cpk > 1) {
        sueta[cpk] = 1;
    }
    for (int i = 0; i < n; ++i) {
        long long cur;
        cin >> cur;
        for (auto x : sueta) {
            int cnt = 0;
            while(cur % sueta.first == 0) {
                ++cnt;
                cur /= sueta.first;
            }
        }
    }
    if (sueta.empty())
        cout << "YES\n";
    else
        cout << "NO\n";
    return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;
int const N = 1e6 + 10;
int dat[N];

int main() {
    long long n, k;
    cin >> n >> k;
    for (int i = 0; i < n; ++i) {
        long long c;
        cin >> c;
        for (long long i = 2; i * i <= c; ++i) {
            if (c % i == 0) {
                int cnt = 0;
                while(c % i == 0) {
                    ++cnt;
                    c /= i;
                }
                dat[i] = max(dat[i], cnt);
            }
        }
        if (c > 1)
            dat[c] = max(dat[c], 1);
    }
    for (long long i = 2; i * i <= k; ++i) {
        if (k % i == 0) {
            int cnt = 0;
            while(k % i == 0) {
                ++cnt;
                k /= i;
            }
            if (dat[i] < cnt) {
                cout << "NO\n";
                return 0;
            }
        }
    }
    if (k > 1 && !dat[k]) {
        cout << "NO\n";
        return 0;
    }
    cout << "YES\n";
    return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>
#include <map>

using namespace std;
int const N = 1e6 + 10;
int dat[N];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    long long n, k;
    cin >> n >> k;
    map<int, int> sueta;
    long long cpk = k;
    for (long long i = 2; i * i <= cpk; ++i) {
        if (cpk % i == 0) {
            int cnt = 0;
            while(cpk % i == 0) {
                ++cnt;
                cpk /= i;
            }
            sueta[i] = cnt;
        }
    }
    if (cpk > 1) {
        sueta[cpk] = 1;
    }
    for (int i = 0; i < n; ++i) {
        long long cur;
        cin >> cur;
        vector<int> er;
        for (auto x : sueta) {
            int cnt = 0;
            while(cur % x.first == 0) {
                ++cnt;
                cur /= x.first;
            }
            if (cnt >= x.second) {
                er.push_back(x.first);
            }
        }
        for (auto x : er)
            sueta.erase(sueta.find(x));
    }
    if (sueta.empty())
        cout << "YES\n";
    else
        cout << "NO\n";
    return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;
int const N = 1e6 + 10;
int dat[N];

int main() {
    long long n, k;
    cin >> n >> k;
    for (int i = 0; i < n; ++i) {
        long long c;
        cin >> c;
        for (long long i = 2; i <= 1000; ++i) {
            if (c % i == 0) {
                int cnt = 0;
                while(c % i == 0) {
                    ++cnt;
                    c /= i;
                }
                dat[i] = max(dat[i], cnt);
            }
        }
        if (c > 1)
            dat[c] = max(dat[c], 1);
    }
    for (long long i = 2; i * i <= k; ++i) {
        if (k % i == 0) {
            int cnt = 0;
            while(k % i == 0) {
                ++cnt;
                k /= i;
            }
            if (dat[i] < cnt) {
                cout << "NO\n";
                return 0;
            }
        }
    }
    if (k > 1 && !dat[k]) {
        cout << "NO\n";
        return 0;
    }
    cout << "YES\n";
    return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main() {
    long long n, k;
    cin >> n >> k;
    long long nok = -1;
    for (int i = 0; i < n; ++i) {
        long long c;
        cin >> c;
        if (nok == -1) {
            nok = c;
            continue;
        }
        long long tmp =  __gcd(nok, c);
        nok = nok * c / tmp;
    }
    if (nok % k == 0) {
        cout << "YES\n";
    }
    else {
        cout << "NO\n";
    }
    return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>
#include <map>

using namespace std;
int const N = 1e6 + 10;
int dat[N];

int main() {
    long long n, k;
    cin >> n >> k;
    map<int, int> sueta;
    long long cpk = k;
    for (long long i = 2; i * i <= cpk; ++i) {
        if (cpk % i == 0) {
            int cnt = 0;
            while(cpk % i == 0) {
                ++cnt;
                cpk /= i;
            }
            sueta[i] = cnt;
        }
    }
    if (cpk > 1) {
        sueta[cpk] = 1;
    }
    for (int i = 0; i < n; ++i) {
        long long cur;
        cin >> cur;
        vector<int> er;
        for (auto x : sueta) {
            int cnt = 0;
            while(cur % x.first == 0) {
                ++cnt;
                cur /= x.first;
            }
            if (cnt >= x.second) {
                er.push_back(x.first);
            }
        }
        for (auto x : er)
            sueta.erase(sueta.find(x));
    }
    if (sueta.empty())
        cout << "YES\n";
    else
        cout << "NO\n";
    return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main() {
    long long n, k;
    cin >> n >> k;
    for (int i = 0; i < n; ++i) {
        long long c;
        cin >> c;
        k /= __gcd(k, c);
    }
    if (k == 1) {
        cout << "YES\n";
    }
    else {
        cout << "NO\n";
    }
    return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main() {
    long long n, k;
    cin >> n >> k;
    long long nok = 0;
    for (int i = 0; i < n; ++i) {
        long long c;
        cin >> c;
        long long tmp =  __gcd(nok, c);
        nok = nok * c / tmp;
    }
    if (nok % k == 0) {
        cout << "YES\n";
    }
    else {
        cout << "NO\n";
    }
    return 0;
}


#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;
int const N = 1e6 + 10;
int dat[N];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    long long n, k;
    cin >> n >> k;
    for (int i = 0; i < n; ++i) {
        long long c;
        cin >> c;
        for (long long i = 2; i * i <= c; ++i) {
            if (c % i == 0) {
                int cnt = 0;
                while(c % i == 0) {
                    ++cnt;
                    c /= i;
                }
                dat[i] = max(dat[i], cnt);
            }
        }
        if (c > 1)
            dat[c] = max(dat[c], 1);
    }
    for (long long i = 2; i * i <= k; ++i) {
        if (k % i == 0) {
            int cnt = 0;
            while(k % i == 0) {
                ++cnt;
                k /= i;
            }
            if (dat[i] < cnt) {
                cout << "NO\n";
                return 0;
            }
        }
    }
    if (k > 1 && !dat[k]) {
        cout << "NO\n";
        return 0;
    }
    cout << "YES\n";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define for1(i,a,b) for(long long int i=a;i<b;i++)
#define for2(i,a,b) for(long long int i=a;i>b;i--)

typedef long long int int1;

int main()
{
    int1 t,n,k;
    cin >> n>>k;
    vector<int1>v;
    string s1;
    // int1 lcm;
    // int1 g;
    for1(i,0,n)
    {
    	cin >> t;
    	v.pb(t);
    }
    int1 g =v[0];
    int1 lcm = v[0];
    for1(i,1,n)
    {
    	if(__gcd(k,v[i]) !=1)
    	{
    		g =__gcd(lcm,v[i]);
    	lcm*=v[i]/g;
    	int1 g1 = __gcd(lcm,k);
    	lcm/=g1;
    	k/=g1;
    	}
    }
    // cout << lcm<<endl;
    if(lcm %k == 0)
    {
    	cout << "YES\n";
    }
    else
    	cout <<"NO\n";

}


n = int(input())
arr1, arr2 = list(), list()

for i in range(n):
    line = [int(i) for i in input().split()]
    arr1.append(line[0])
    arr2.append(line[1])

cnt = 0
for i in range(n):
    if not arr1[i] == arr2[i]:
        cnt += 1
        break

if cnt == 0:
    arr1.sort()
    for i in range(1, n):
        if arr1[i] == arr1[i - 1]:
            cnt += 1
            break
    if cnt == 0:
        print('unrated')
    else:
        print('maybe')
else:
    print('rated')


n = int(input())
arr1, arr2 = list(), list()

for i in range(n):
    line = [int(i) for i in input().split()]
    arr1.append(line[0])
    arr2.append(line[1])

cnt = 0
for i in range(n):
    if not arr1[i] == arr2[i]:
        cnt += 1
        break

if cnt == 0:
    if arr1 == sorted(arr1, reverse=True):
        print('maybe')
    else:
        print('unrated')
else:
    print('rated')


A=[]
changed=False
for i in range(int(input())):
    a, b=map(int,input().split())
    if a != b: changed= True
    A +=[a]
if changed == True:
    print("rated")
else:
    s = (A == sorted(A))
    d = len(A) == len(set(A))
    if not s and d:
        print("unrated")
    else:
        print("maybe")


A=[]
changed=False
for i in range(int(input())):
    a, b=map(int,input().split())
    if a != b: changed= True
    A +=[a]
if changed == True:
    print("rated")
else:
    s = (A == sorted(A))

    if not s:
        print("unrated")
    else:
        print("maybe")


A=[]
changed=False
for i in range(int(input())):
    a, b=map(int,input().split())
    if a != b: changed= True
    A +=[a]
if changed == True:
    print("rated")
else:
    s = (A == sorted(A))

    if not s:
        if len(A) == len(set(A)):
            print("unrated")
        else:
            print("maybe")
    else:
        print("maybe")


A=[]
changed=False
for i in range(int(input())):
    a, b=map(int,input().split())
    if a != b: changed= True
    A +=[a]
if changed == True:
    print("rated")
else:
    s = (A[::-1] == sorted(A))

    if not s:
        print("unrated")
    else:
        print("maybe")


n = int(input())
rate = -1
last = -1
for i in range(n):
	(a,b) = (int(i) for i in input().split())
	if a!=b:
		rate = 1
		break
	if (a>last) and (last!=-1) and (rate==-1):
		rate = 0
	last = a
if rate==1:
	print('rated')
elif rate==0:
	print('unrated')
else:
	print('maybe')


n = int(input())
rate = -1
last = -1
for i in range(n):
	(a,b) = (int(i) for i in input().split())
	if a!=b:
		rate = 1
		break
	if a>last and last!=-1 and not rate:
		rate = 0
	last = a
if rate==1:
	print('rated')
elif rate==0:
	print('unrated')
else:
	print('maybe')


n = int(input())
rate = -1
last = -1
for i in range(n):
	(a,b) = (int(i) for i in input().split())
	if a!=b:
		rate = 1
		break
	if a>last and last!=-1:
		rate = 0
		break
	last = a
if rate==1:
	print('rated')
elif rate==0:
	print('unrated')
else:
	print('maybe')


n = int(input())
res1 = []
result = 0
for i in range(n):
    res = [i for i in input().split()]
    res1.append(int(res[0]))
    if res[0] != res[1]:
        result = 1
if result:
    print('rated')
elif res1 == sorted(res1, key=int, reverse=True):
    print('maybe')
else:
    print('unrated')


n = int(input())
res1 = []
result = 0
for i in range(n):
    res = [i for i in input().split()]
    res1.append(int(res[0]))
    if res[0] != res[1]:
        result = 1
if res1 == sorted(res1, key=int, reverse=True):
    print('maybe')
elif result == 1:
    print('rated')
else:
    print('unrated')


n = int(input())
res1 = []
result = 0
for i in range(n):
    res = [i for i in input().split()]
    res1.append(res[0])
    if res[0] != res[1]:
        result = 1
if res1 == res1.sort(key=int, reverse=True):
    print('maybe')
elif result == 1:
    print('rated')
else:
    print('unrated')


n = int(input())
res1 = []
result = 0
for i in range(n):
    res = [i for i in input().split()]
    res1.append(int(res[0]))
    if res[0] != res[1]:
        result = 1
if res1 == res1.sort(key=int, reverse=True):
    print('maybe')
elif result == 1:
    print('rated')
else:
    print('unrated')


n = int(input())
res1 = []
result = 0
for i in range(n):
    res = [i for i in input().split()]
    res1.append(int(res[0]))
    if res[0] != res[1]:
        result = 1
res1rev = sorted(res1, key=int, reverse=True)
print(res1rev)
if res1 == res1rev:
    print('maybe')
elif result == 1:
    print('rated')
else:
    print('unrated')


a=int(input())

b=[]

for i in range(a):
    c,d=map(int,input().split())
    b.append(d)
    if(b!=a):
        print('rated')
        break
else:
    e=sorted(b)
    b.reverse()
    if(e==b):
        print('maybe')
    else:
        print('unrated')


a=int(input())

b=[]

for i in range(a):
    c,d=map(int,input().split())
    b.append(d)
    if(b!=a):
        print('rated')

else:
    e=sorted(b)
    b.reverse()
    if(e==b):
        print('maybe')
    else:
        print('unrated')


a=int(input())

b=[]

for i in range(a):
    c,d=map(int,input().split())
    b.append(d)
    if(c!=d):
        print('rated')
        break
else:
    e=sorted(b)
    b.reverse()
    if(e==b):
        print('maybe')
    else:
        print('unrated')


n = int(input())

before = []
after = []
flag = True

for i in range(n):
    x, y = input().split()
    before.append(x)
    after.append(y)

for i in range(n):
    if after[i] != before [i]:
        print("rated")
        break
    elif after[i-1] < after[i] and i != 0 :
        flag = False
        break
if flag == False:
    print("unrated")
else:
    print("maybe")


n = int(input())

before = []
after = []
flag = True
secflag = True

for i in range(n):
    x, y = input().split()
    before.append(x)
    after.append(y)

for i in range(n):
    if after[i] != before [i]:
        print("rated")
        secflag = False
        break
    elif after[i-1] < after[i] and i != 0 :
        flag = False
        break
if flag == False and secflag == True:
    print("unrated")
elif flag == True and secflag == True:
    print("maybe")


n = int(input())

before = []
after = []
flag = True
secflag = True

for i in range(n):
    x, y = input().split()
    before.append(x)
    after.append(y)

for i in range(n):
    if before[i] != after[i]:
        print("rated")
        secflag = False
        break
    elif after[i - 1] < after[i] and i != 0:
        flag = False

if flag == False and secflag == True:
    print("unrated")
elif flag == True and secflag == True:
    print("maybe")


# n,k = map(int,input().split())
#a=map(int,raw_input().split())
#x = list(map(int, input().split()))

n = int(input())

before = []
after = []
flag = True
SecFlag = True

for i in range(n):
    x, y = input().split()
    before.append(x)
    after.append(y)

for i in range(n):
    if before[i] != after[i]:
        print("rated")
        SecFlag = False
        break
    elif (i != 0) and (int(before[i]) > int(before[i-1])) :
        print(before[i],before[i-1],i)
        flag = False

if flag == False and SecFlag == True:
    print("unrated")
elif flag == True and SecFlag == True:
    print("maybe")


# n,k = map(int,input().split())
#a=map(int,raw_input().split())
#x = list(map(int, input().split()))

n = int(input())

before = []
after = []
flag = True
SecFlag = True

for i in range(n):
    x, y = input().split()
    before.append(x)
    after.append(y)

for i in range(n):
    if before[i] != after[i]:
        print("rated")
        SecFlag = False
        break
    elif (i != 0) and (int(before[i]) > int(before[i-1])) :

        flag = False

if flag == False and SecFlag == True:
    print("unrated")
elif flag == True and SecFlag == True:
    print("maybe")


n = int(input())

before = []
after = []
flag = True
secflag = True

for i in range(n):
    x, y = input().split()
    before.append(x)
    after.append(y)

for i in range(n):
    if before [i] == after[i]:
        print("rated")
        secflag = False
        break
    elif after[i-1] < after[i] and i != 0 :
        flag = False
        break
if flag == False and secflag == True:
    print("unrated")
elif flag == True and secflag == True:
    print("maybe")


n = int(input())

before = []
after = []
flag = True
SecFlag = True

for i in range(n):
    x, y = input().split()
    before.append(x)
    after.append(y)

for i in range(n):
    if before[i] != after[i]:
        print("rated")
        SecFlag = False
        break
    elif before[i - 1] < before[i] and i != 0:
        flag = False

if flag == False and SecFlag == True:
    print("unrated")
elif flag == True and SecFlag == True:
    print("maybe")


n=int(input());s=[]
for i in range(n):
	a,b=map(int,input().split())
	if a!=b:
		print("rated")
		break
	s.append(a)
else:
	l=sorted(s)
	l.reverse()
	if l==s:
		print("maybe")
	else:
		print("unrated")

# n,a,f=int(input()),[],0
# for i in range(n):
# 	l=input().split()
# 	a+=[l[0]]
# 	if l[0]!=l[1]:f=1
# if f:
# 	print('rated')
# elif a[::-1]==sorted(a,key=int):
# 	print('maybe')
# else:
# 	print('unrated')

# EXAMPLE FOR sorted with key>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# # take the second element for sort
# def take_second(elem):
#     return elem[1]

# # random list
# random = [(2, 2), (3, 4), (4, 1), (1, 3)]

# # sort list with key
# sorted_list = sorted(random, key = take_second)

# # print list
# print('Sorted list:', sorted_list)

# HERE output will be>>>
# Sorted list: [(4, 1), (2, 2), (1, 3), (3, 4)]
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.

# count=4126
# for i in range(int(input())):
# 	a,b=map(int,input().split())
# 	if a!=b:
# 		print("rated")
# 		break
# 	elif a==b and a<=count:
# 		count=a
# 	else:
# 		print("unrated")
# 		break
# else:
# 	print("maybe")

# count=4126
# for i in range(int(input())):
# 	a,b=map(int,input().split())
# 	if a!=b:
# 		print("rated")
# 		break
# 	elif a==b and count<a:
# 		print("unrated")
# 		break
# 	else:
# 		count=a
# else:
# 	print("maybe")


count=4126
for i in range(int(input())):
	a,b=map(int,input().split())
	if a!=b:
		print("rated")
		break
	elif a==b and count<a:
		print("unrated")
		break
	else:
		count=a
else:
	print("maybe")


n,r,u,p = int(input()),0,0,int(9999)
rating = [input().split() for _ in range(n)]
for i in range(n):
      if rating[i][0] != rating[i][1]:
              r = 1
              print('rated')
              exit()
      elif int(rating[i][0]) > p:
              u = 1
      p = int(rating[i][0])

if u:
        print('unrated')
else:
        print ('maybe')


n,r,u,p = int(input()),0,0,9999
rating = [input().split() for _ in range(n)]
for i in range(n):
      if rating[i][0] != rating[i][1]:
              r = 1
              print('rated')
              exit()
      elif i>0 and rating[i-1][0] < rating[i][0]:
              u = 1
if u:
        print('unrated')
else:
        print ('maybe')


n,r,u = int(input()),0,0
rating = [input().split() for _ in range(n)]
for i in range(n):
      if rating[i][0] != rating[i][1]:
              r = 1
              print('rated')
              exit()
      elif i>0 and rating[i-1] < rating[i]:
              u = 1
if u:
        print('unrated')
else:
        print ('maybe')


n,r,u,p = int(input()),0,0,9999
rating = [input().split() for _ in range(n)]
for i in range(n):
      if rating[i][0] != rating[i][1]:
              r = 1
              print('rated')
              exit()
      elif rating[i][0] > p:
              u = 1
      p = rating[i][0]
if u:
        print('unrated')
else:
        print ('maybe')


n,r,u = int(input()),0,0
rating = [input().split() for _ in range(n)]
for i in range(n):
      if rating[i][0] != rating[i][1]:
              r = 1
              print('rated')
              exit()
      elif i>0 and rating[i-1] < rating[i]:
              u = 1
              print('unrated')
              exit()
print ('maybe')


n = int(input())

arr = []

for _ in range(n):
    a, b = map(int, input().split())
    if a - b == 0:
        arr.append(0)
    else:
        arr.append(1)
if all(x == 0 for x in arr):
    print("not rated")
    exit()

if all(x!= 0 for x in arr):
    print("rated")
    exit()
print("maybe")


n = int(input())
results = []
for i in range(n):
    results.append(list(map(int, input().split())))

for r in results:
    if r[0] != r[1]:
        print("rated")
        exit()

for i in range(n):
    for j in range(i):
        if results[i][0] > results[j][0]:
            print("unrated")
            exit()

print("maybe")


n = int(input())
t = []
for i in range(n):
    a, b = map(int, input().split())
    if a - b != 0:
        print('rated')
        exit()
    else:
        t.append(a)
        if min(t) != a:
            print('unrated')
            exit()
print('maybe')

# CodeForcesian
# ♥
# سرمایه گذاری بر روی دانش بیشترین بهره را دارد


n = int(input())
t = []
f = True
for i in range(n):
    a, b = map(int, input().split())
    if a - b != 0:
        print('rated')
        exit()
    else:
        t.append(a)
        if min(t) != a:
            f = False
print('unrated' if f is False else 'maybe')

# CodeForcesian
# ♥
# سرمایه گذاری بر روی دانش بیشترین بهره را دارد


n = int(input())
t = []
for i in range(n):
    a, b = map(int, input().split())
    if a != b:
        print('rated')
        exit()
    else:
        t.append(a)
        if min(t) != a:
            print('unrated')
            exit()
print('maybe')

# CodeForcesian
# ♥

# سرمایه گذاری بر روی دانش بیشترین بهره را دارد


n=[]
a=0
s=0
z=int(input())
if 2<=z<=1000:
    for x in range(z):
        c1,c2=[int(b) for b in input().split()]
        n.append(c1)
        n.append(c2)
    #print('n=',n)
    d=int(len(n)/2)

    for m in range(d):
       # print('n[a],   ,n[a+1]',n[a],n[a+1])
        if n[a]!=n[a+1]:
            print('rated')
            s=s+1
           # print('s in rated:',s)
            break
        a+=2
    a=0
    if s==0:
        for f in range(d):

            if a>len(n)-2:
                break

            elif n[a]>n[a-2] and a>=2 :
                print('unrated')
                s=s+1
               # print('s in unrated:',s)
                break     #zbt dee mynf3sh break

            a+=2
       # print('a=',a)

    if s==0:
       #print('s in maybe:',s)
       print('maybe')


n=[]
a=0
s=0
z=int(input())
if 2<=z<=1000:
    for x in range(z):
        c1,c2=[int(b) for b in input().split()]
        n.append(c1)
        n.append(c2)
    #print('n=',n)
    d=int(len(n)/2)

    for m in range(d):
       # print('n[a],   ,n[a+1]',n[a],n[a+1])
        if n[a]!=n[a+1]:
            print('rated')
            s=s+1
           # print('s in rated:',s)
            break

        elif a>len(n)-2:
            break

        elif n[a]>n[a-2] and a>=2 :
            print('unrated')
            s=s+1
           # print('s in unrated:',s)
            break     #zbt dee mynf3sh break

        a+=2
       # print('a=',a)

    if s==0:
       #print('s in maybe:',s)
       print('maybe')


n=[]
a=0
s=0
z=int(input())
if 2<=z<=1000:
    for x in range(z):
        c1,c2=[int(b) for b in input().split()]
        n.append(c1)
        n.append(c2)
    #print('n=',n)
    d=int(len(n)/2)

    for m in range(d):
       # print('n[a],   ,n[a+1]',n[a],n[a+1])
        if n[a]!=n[a+1]:
            print('rated')
            s=s+1
           # print('s in rated:',s)
            break
        a+=2
    a=0
    for f in range(d):

        if a>len(n)-2:
            break

        elif n[a]>n[a-2] and a>=2 :
            print('unrated')
            s=s+1
           # print('s in unrated:',s)
            break     #zbt dee mynf3sh break

        a+=2
       # print('a=',a)

    if s==0:
       #print('s in maybe:',s)
       print('maybe')


n=[]
a=0
s=0
z=int(input())
if 2<=z<=1000:
    for x in range(z):
        c1,c2=[int(b) for b in input().split()]
        n.append(c1)
        n.append(c2)
    #print('n=',n)
    d=int(len(n)/2)

    for m in range(d):

        if n[a]!=n[a+1]:
            print('rated')
            s=s+1
            break

        elif a<len(n)-2:
            break

        elif n[a]<n[a+2] :
            print('unrated')
            s=s+1
            break     #zbt dee mynf3sh break

        a+=2
        print('a=',a)

    if a==0:
       print('maybe')


descending = True
prev = 9999

for _ in range(int(input())):
    a, b = map(int, input().split())
    if a != b:
        print('rated')
        break
    if a > prev:
        descending = False
    prev = a
else:
    print('maybe' if descending else 'unrated')


descending = True
prev = '9999'

for _ in range(int(input())):
    a, b = input().split()
    if a != b:
        print('rated')
        break
    if a > prev:
        descending = False
    prev = a
else:
    print('maybe' if descending else 'unrated')


n=int(input())
d=list(range(n))
u=True
e=True
for i in range(n):
    a,b=map(int,list(input().split()))
    if (a!=b):
        print("rated")
        e=False
        break
    d[i]=a
if e:
    for i in range(n):
        if (i>0):
            if d[i]>d[i-1]:
                print("unrated")
                u=False
                break
    if u:
        print("maybe")


n=int(input())
d=list(range(n))
u=True
e=True
for i in d:
    a,b=map(int,list(input().split()))
    if (a!=b):
        print("rated")
        e=False
        break
    d[i]=a
if e:
    for i in range(n):
        if (i>0):
            if d[i]>d[i-1]:
                print("unrated")
                u=False
                break
    if u:
        print("maybe")


import sys
n = int(input())
lst = []
for i in range(n):
    L = [int(i) for i in input().split()]
    if L[0] != L[1]:
        print("rated")
        sys.exit()
    else:
        lst.append(L)
for i in range(n):
    for j in range(i + 1,n):
        if lst[i][0] < lst[j][0]:
            print("unrated")
            sys.exit()
print("maybe")


n = int(input())
lst = []
for i in range(n):
    lst.append([int(i) for i in input().split()])
def checkEqual(lst):
    if lst[0] == lst[1]:
        return True
    else:
        return False
for i in lst:
    if checkEqual(i) == False:
        print("rated")
LST = []
for i in lst:
    LST.append(i[0])
if LST.reverse() != lst.sort():
    print("unrated")
else:
    print("maybe")


n = int(input())
l = [[*map(int, input().split())] for _ in range(n)]
a = b = False
cur = float('inf')
for x, y in l:
    a |= y - x != 0
    b |= cur > x
    cur = min(cur, x)
if a:
    print("rated")
elif b:
    print("maybe")
else:
    print("unrated")


n = int(input())
l = [[*map(int, input().split())] for _ in range(n)]
a = b = False
cur = float('inf')
for x, y in l:
    a |= y - x != 0
    b |= cur > x
    cur = min(cur, x)
if a:
    print("rated")
elif b:
    print("unrated")
else:
    print("maybe")


n = int(input())
l = [[*map(int, input().split())] for _ in range(n)]
a = b = False
cur = float('inf')
for x, y in l:
    a |= y - x != 0
    b |= cur < x
    cur = x
if a:
    print("rated")
elif b:
    print("unrated")
else:
    print("maybe")


import sys
from math import sqrt
input = lambda: sys.stdin.readline()
def Main():

	n = int(input())
	v=[]
        for i in range(n):
		d=[0,0]
		d[0],d[1]=map(int,input().split(' '))
		v.append(d)
	ans = 'maybe'
	min =4127
	for i in range(n):
		if v[i][0]!=v[i][1]:
			ans = 'rated'
			break
	if ans=='maybe':
		for i in range(n):
			if i==0:
				min = v[i][1]
			elif v[i][1]>v[i-1][1]:
				ans = 'unrated'
				break
	print(ans)
if __name__ == '__main__':
	Main()


import sys
from math import sqrt
input = lambda: sys.stdin.readline()
def Main():
	n = int(input())
	v=[]
	for i in range(n):
		d=[0,0]
		d[0],d[1]=map(int,input().split(' '))
		v.append(d)
	ans = 'maybe'
	min =4127
	for i in range(n):
		if v[i][0]!=v[i][1]:
			ans = 'rated'
			break
	if ans=='maybe':
		for i in range(n):
			if i==0:
				min = v[i][1]
			elif v[i][1]>v[i-1][1]:
				ans = 'unrated'
				break
	print(ans)
if __name__ == '__main__':
	Main()


n=eval(input())
i=1
y=[]
b=[]
o="maybe"
while(i<=n):
  a=list(map(int,input().split()))
  y+=[a[0]]
  b+=[a[1]]
  i+=1
i=0


n=eval(input())
i=1
y=[]
b=[]
o="maybe"
while(i<=n):
  a=list(map(int,input().split()))
  y+=[a[0]]
  b+=[a[1]]
  i+=1
i=0
if(y==b):
  while(i<len(b)-1)and(o=="maybe"):
    if(b[i]>=b[i+1]):
       o="maybe"
    else:
       o="unrated"
    i+=1
else:
  o="rated"
print(o)


from sys import stdin, stdout

number_of_participant = int(stdin.readline())

rating_before = []
rating_after = []

for i in range(number_of_participant):
	rating_string = stdin.readline().split()
	rating_before.append(int(rating_string[0]))
	rating_after.append(int(rating_string[1]))

for i in range(number_of_participant):
	if rating_before[i] != rating_after[i]:
		stdout.write("rated\n")
		exit()

rating_before_sorted = rating_before.copy()
rating_before_sorted.sort(reverse=True)

for i in range(number_of_participant):
	if rating_before[i] != rating_before_sorted[i]:
		stdout.write("unrated\n")
		exit()

stdout.write("maybe\n")


from sys import stdin, stdout

number_of_participant = int(stdin.readline())

rating_before = []
rating_after = []

for i in range(number_of_participant):
	rating_string = stdin.readline().split()
	rating_before.append(rating_string[0])
	rating_after.append(rating_string[1])

for i in range(number_of_participant):
	if rating_before[i] != rating_after[i]:
		stdout.write("rated\n")
		exit()

rating_before_sorted = rating_before.copy()
rating_before_sorted.sort(reverse=True)
for i in range(number_of_participant):
	if rating_before[i] != rating_before_sorted[i]:
		stdout.write("unrated\n")
		exit()

stdout.write("maybe\n")


from sys import stdin, stdout

number_of_participant = int(stdin.readline())

rating = []

for i in range(number_of_participant):
	x, y = map(int, stdin.readline().split())
	if x != y:
		stdout.write("rated\n")
		exit()
	rating.append(x)

rating_sorted = rating.copy()
rating_sorted.sort(reverse=True)

if rating_sorted == rating:
    stdout.write("maybe\n")
    exit()

stdout.write("unrated\n")


n = int(input())

r = 1
l = []
c = []

for i in range(n):
    x, y = map(int, input().split())
    if x != y:
        r = 0
        break
    l.append(x)
    c.append(x)

c.sort()

if r == 0:
    print("rated")
else:
    if c == l[::-1]:
        print("maybe")
    else:
        print("unrated")


n = int(input())
ans = 0
pre = 0
count = 0
for i in range(n):
    (a, b) = map(int, input().split())
    if pre and pre >= b:
        count += 1
    pre = b
    if a > b or b < a:
        ans = 1
        break

if ans == 1:
    print("rated")
elif count+1 == n:
    print("maybe")
else:
    print("unrated")


# (n, k) = map(int, input().split(' '))
# arr = list(map(int, input().split()))
n = int(input())
ans = 0
pre = 0
count = 0
for i in range(n):
    (a, b) = map(int, input().split())
    if pre and pre >= b:
        count += 1
    pre = b
    if not(a == b):
        ans = 1
        break

if ans == 1:
    print("rated")
elif count+1 == n:
    print("maybe")
else:
    print("unrated")


n=int(input())
rated=False
c=[]
for i in range(n):
    a,b=map(int,input().split())
    if a!=b:
        rated=True
    c=append(a)
if rated ==True:
    print"rated"
else:
    if c==sorted(c,reverse=True):
        print"maybe"
    else:
        print "unrated"


n=int(input())
rated=False
c=[]
for i in range(n):
    a,b=map(int,input().split())
    if a!=b:
        rated=True
    c.append(a)
if rated ==True:
    print("rated")
else:
    if c==sorted(c,reverse=True):
        print("maybe")
    else:
        print ("unrated")


n=input()
rated=False
c=[]
for i in range(n):
    a,b=input().split()
    if a!=b:
        rated=True
    c=append(a)
if rated ==True:
    print"rated"
else:
    if c==sorted(c,reverse=True):
        print"maybe"
    else:
        print "unrated"


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,a,b) for(ll i=a; i<b; i++)
bool sortedd(ll a[],ll n){
    f(i,0,n-1)if(a[i]<a[i+1]) return false;
    return true;
}
int main(){
    ll n; cin>>n; bool rated=false;
    ll a[n]; f(i,0,n){
        ll x,y; cin>>x>>y; a[i]=x; if(x!=y) rated=true;
    }
    if(rated)cout<<"rated";
    else{ if(sortedd(a,n)) cout<<"maybe"; else cout<<"unsorted";}

}


n=int(input())
rated=False
c=[]
for i in range(n):
    a,b=map(int,input().split())
    if a!=b:
        rated=True
    c=append(a)
if rated ==True:
    print("rated")
else:
    if c==sorted(c,reverse=True):
        print("maybe")
    else:
        print ("unrated")


arr=[]
num=int(input())
for t in range(num):
    arr.append(list(map(int,input().split())))

for t in arr:
    if t[0]!=t[1]:
        print("rated")
        exit()
for t in range(num):
    for tt in range(t):
        if arr[t][0]>arr[tt][0]:
            print("unrated")
            exit()
print("maybe")


for t in arr:
    if t[0]!=t[1]:
        print("rated")
        exit()
for t in range(num):
    for tt in range(t):
        if arr[t][0]>arr[tt][0]:
            print("unrated")
            exit()
print("maybe")


n = int(input())

rs = []
for i in range(n):
    ab = input().strip().split(' ')
    a = int(ab[0])
    b = int(ab[1])
    if a!=b:
        print('rated')
        break
    else:
        rs.append(b)

rssrt = rs.copy()
rssrt.sort(reverse=True)
if rssrt==rs:
    print('maybe')
else:
    print('unrated')


n = int(input())
flag = 0
rs = []
for i in range(n):
    ab = input().strip().split(' ')
    a = int(ab[0])
    b = int(ab[1])
    if a!=b:
        print('rated')
        flag = 1
        break
    else:
        rs.append(b)

if flag==0:
    rssrt = rs.copy()
    rssrt.sort(reverse=True)
    if rssrt==rs:
        print('maybe')
    else:
        print('unrated')


import sys
n = input()
n = int(n)
a = []
for i in range(0,n):
    t1,t2 = input().split()
    a.append(t1)
    a.append(t2)

i = 1
change = 2
while i < n*2:
    if a[i] != a[i -1]:
        change = 1
        break;
    i += 2

if change == 1:
    print ("rated")
    sys.exit()

i = 2
while i < n * 2:
    if a[i] > a[i - 2]:
        change = 0
        break;
    i += 2

if change == 1:
    print ("rated")
elif change == 0:
    print ("unrated")
else:
    print ("maybe")


#!/usr/bin/python
import random
import math
import sys
n = int(input())

l = [[0 for i in range(2)] for j in range(n)]
for i in range(0,n):
    t = [int(x) for x in input().split()]
    for j in range(0,2):
        l[i][j] = t[j]

rate = 0
for i in range(0,n):
    if l[i][0] != l[i][1]:
        rate = 1
        break
if rate == 1:
    print ("rated")
    sys.exit()
unrated  = 0
for i in range(0,n - 1):
    if l[i][0] < l[i + 1][0]:
        unrated = 1
        break

if unrated == 1:
    print ("unrated")
    sys.exit()

print ("maybe")


n = input()
n = int(n)
a = []
for i in range(0,n):
    t1,t2 = input().split()
    a.append(t1)
    a.append(t2)

i = 1
change = 2
while i < n*2:
    if a[i] != a[i -1]:
        change = 1
        break;
    i += 2

i = 2
while i < n * 2:
    if a[i] > a[i - 2]:
        change = 0
        break;
    i += 2

if change == 1:
    print ("rated")
elif change == 0:
    print ("unrated")
else:
    print ("maybe")


n=int(input())
flag=0
aaa=[]
bbb=[]
for i in range(n):
    a, b=map(int, input().split())
    aaa.append(a)
    bbb.append(b)

    ab=abs(a-b)
    if(ab>0):    #for rated
        print("rated")
        flag=1
        break
    elif(i>0 and aaa[i-1]<aaa[i] and ab==0):
        print("unrated")
        flag=1
        break
if(flag==0):
    print("maybe")


n=int(input())
flag=0
aaa=[]
bbb=[]
for i in range(n):
    a, b=map(int, input().split())
    aaa.append(a)
    bbb.append(b)

    ab=abs(a-b)
    if(ab>0):    #for rated
        print("rated")
        flag=1
        break
    elif(i>0 and aaa[i-1]<aaa[i]):
        print("unrated")
        flag=1
        break
if(flag==0):
    print("maybe")


n=int(input())
flag=0
aaa=[]
for i in range(n):
    a, b=map(int, input().split())

    if(a!=b):               #for rated
        flag=1

    else:
        aaa.append(a)
#print(list(reversed(aaa)))

if(flag==1):
    print("rated")
elif list(reversed(aaa))!=sorted(aaa):
    print("unrated")
else:
    print("maybe")


n = int(input())
a = []
b = []
for i in range(n):
    a1, b1 = map(int, input().split())
    a.append(a1)
    b.append(b1)
for i in range(n):
    if a[i] != b[i]:
        print("rated")
        break
else:
    if b == sorted(a, reverse=True):
        print("maybe")
    else:
        print("unrated")


n = int(input())
a = []
b = []
for i in range(n):
    a1, b1 = map(int, input().split())
    a.append(a1)
    b.append(b1)
for i in range(n):
    if a[i] != b[i]:
        print("rated")
        break
else:
    if (b == sorted(a, reverse=True)) or (b == sorted(a)):
        print("maybe")
    else:
        print("unrated")


##n = int(input())
##a = list(map(int, input().split()))
##print(' '.join(map(str, res)))

n = int(input())
a = list()
b = list()
for i in range(n):
    [x, y] = list(map(int, input().split()))
    a.append(x)
    b.append(y)

if a != b:
    print('rated')
    exit(0)

c = b
c.sort()
if b == c:
    print('maybe')
else:
    print('unrated')


##n = int(input())
##a = list(map(int, input().split()))
##print(' '.join(map(str, res)))

n = int(input())
a = list()
b = list()
for i in range(n):
    [x, y] = list(map(int, input().split()))
    a.append(x)
    b.append(y)

if a != b:
    print('rated')
    exit(0)

c = list(b)
c.sort(key=None, reverse=True)
if b == c:
    print('maybe')
else:
    print('unrated')


def solution():
    arr = []
    for _ in range(int(input())):
        x,y = (int(i) for i in input().split(' '))
        arr.append((x,y))
    m = float('inf')
    for x,y in arr:
        if x != y:
            print("rated")
            return
        if m < x:
            print('unrated')
            return
        else:
            m = x
    print('maybe')

if __name__ == "__main__":
    solution()


def solution():
    arr = []
    for _ in range(int(input())):
        x,y = (int(i) for i in input().split(' '))
        arr.append((x,y))
    m = float('inf')
    for x,y in arr:
        if x != y:
            print("rated")
            return
    for x,y in arr:
        if m < x:
            print('unrated')
            return
        else:
            m = x
    print('maybe')

if __name__ == "__main__":
    solution()


n = int(input())
c = 0
k = 0
j = []
v = []
for i in range(n):
    a,m = map(int, input().split())
    if a > m or a < m:
        c += 1
    j.append(a)
    v.append(m)
if c >= 1:
    print("rated")
elif len(j) <= 2:
    if j[0] < j[1]:
        print("unrated")
    else:
        print("maybe")
else:
    for i in range(1,n-1,1):
        if j[i] < j[i+1]:
            k += 1
    if k >= 1:
        print("unrated")
    else:
        print("maybe")


n = int(input())
c = 0
k = 0
j = []
v = []
for i in range(n):
    a,m = map(int, input().split())
    if a > m or a < m:
        c += 1
    j.append(a)
    v.append(m)
if c >= 1:
    print("rated")
else:
    for i in range(1,n-1,1):
        if j[i] < j[i+1]:
            k += 1
    if k >= 1:
        print("unrated")
    else:
        print("maybe")


n = int(input())
c = 0
k = 0
j = []
v = []
for i in range(n):
    a,m = map(int, input().split())
    if a > m or a < m:
        c += 1
    j.append(a)
    v.append(m)
if c >= 1:
    print("rated")
else:
    for i in range(len(j)-1):
        if j[i] >= j[i+1]:
            k += 1
    if k >= 1:
        print("maybe")
    else:
        print("unrated")


n = int(input())
c = []; j = 0
for i in range(n):
    a,b = map(int,input().split())
    if a != b:
        print('rated')
        exit()
    c.append(a)
for i in range(len(c)-1):
    if c[i] < c[i+1]:
        print("unrated")
        exit()
    else:
        j += 1
if j == n-1:
    print("maybe")
    exit()


n = int(input())
c = 0
k = 0
j = []
v = []
for i in range(n):
    a,m = map(int, input().split())
    if a > m or a < m:
        c += 1
    j.append(a)
    v.append(m)
if c >= 1:
    print("rated")
elif len(j) <= 2:
    if j[0] < j[1]:
        print("unrated")
    else:
        print("maybe")
else:
    for i in range(1,n-1,1):
        if j[i] > j[i+1]:
            k += 1
    if k >= n - 1:
        print("maybe")
    else:
        print("unrated")


n = int(input())
c = 0; k = 0;j = []
for i in range(n):
    a,m = map(int, input().split())
    if a > m or a < m:
        c += 1
    j.append(a)
if c >= 1: print("rated")
else:
    for i in range(1,n-1,1):
        if j[i] > j[i+1]:
            k += 1
    if k >= 1: print("maybe")
    else: print("unrated")


n = int(input())
d= []
c= []
count =0
for i in range(n):
    a,b = map(str,input().split())
    d.append(a)
    if int(a) != int(b):
        count = 1
        break
    else:
        c.append(a)
if count == 1:
    print('rated')
else:
    c.sort(reverse=True)
    if c == d:
        print('maybe')
    else:
        print('unrated')


n = int(input())
d= []
c= []
count =0
for i in range(n):
    a,b = map(str,input().split())
    d.append(int(a))
    if int(a) != int(b):
        count = 1
        break
    else:
        c.append(int(a))
if count == 1:
    print('rated')
else:
    c.sort(reverse=True)
    if c == d:
        print('maybe')
    else:
        print('unrated')


t=int(input())
x=[]
y=[]
for i in range(t):
    a,b=map(int,input().split())
    x.append(a)
    y.append(b)
z=list(set(map(int,x)))
if x==y and x!=z:
    print("maybe")
elif x==y and x==z:
    print("unrated")
else:
    print("rated")


t=int(input())
x=[]
y=[]
for i in range(t):
    a,b=map(int,input().split())
    x.append(a)
    y.append(b)
z=list(set(map(int,x)))
if x==y and len(x)!=len(z):
    print("maybe")
elif x==y and len(x)==len(z):
    print("unrated")
else:
    print("rated")


n = int(input())
results = []
for i in range(n):
    results.append(list(map(int, input().split())))

for r in results:
    if r[0] != r[1]:
        print("rated")
        exit()

for i in range(n):
    for j in range(i):
        if results[i][0] > results[j][0]:
            print("unrated")
            exit()

print("maybe")


t=int(input())
x=[]
y=[]
for i in range(t):
    a,b=map(int,input().split())
    x.append(a)
    y.append(b)
if x==y and x!=list(set(map(int,x))):
    print("maybe")
elif x==y and x==list(set(map(int,x))):
    print("unrated")
else:
    print("rated")


a=int(input())
b=[]
r=0
ur=0
m=0
j=[]
e,f=map(int,input().split())
b.append(e)
b.append(f)
for i in range(a-1):
    c,d=map(int,input().split())
    b.append(c)
    b.append(d)
    j.append(c)
    j.append(d)
    if c==d and c!=e and d!=f:
        ur+=1
    elif c==d and c==e and d==f:
        m+=1
    elif c!=d:
        r+=1
    e=c
    f=d
j.sort()

j.reverse()

if r>=1:
    print('rated')
elif b!=j and m==0:
    print('unrated')
else:
    print('maybe')


a=int(input())
b=[]
r=0
ur=0
m=0
j=[]
for i in range(a):
    c,d=map(int,input().split())
    b.append(c)
    if c!=d:
        r+=1
j = sorted(b, reverse=True)
if r>=1:
    print('rated')
elif b!=j:
    print('unrated')
else:
    print('maybe')


a=int(input())
b=[]
r=0
ur=0
m=0
j=[]
e,f=map(int,input().split())
for i in range(a-1):
    c,d=map(int,input().split())
    b.append(c)
    b.append(d)
    j.append(c)
    j.append(d)
    if c==d and c!=e and d!=f:
        ur+=1
    elif c==d and c==e and d==f:
        m+=1
    elif c!=d:
        r+=1
    e=c
    f=d

j.sort()

j.reverse()

if r>=1:
    print('rated')
elif b!=j:
    print('unrated')
else:
    print('maybe')


a=int(input())
b=[]
r=0
ur=0
m=0
j=[]
e,f=map(int,input().split())
b.append(e)
b.append(f)
for i in range(a-1):
    c,d=map(int,input().split())
    b.append(c)
    b.append(d)
    j.append(c)
    j.append(d)
    if c==d and c!=e and d!=f:
        ur+=1
    elif c==d and c==e and d==f:
        m+=1
    elif c!=d:
        r+=1
    e=c
    f=d
print(j,b)
j.sort()

j.reverse()

if r>=1:
    print('rated')
elif b!=j:
    print('unrated')
else:
    print('maybe')


a=int(input())
b=[]
r=0
ur=0
m=0
j=[]
e,f=map(int,input().split())
b.append(e)
b.append(f)
for i in range(a-1):
    c,d=map(int,input().split())
    b.append(c)
    b.append(d)
    j.append(c)
    j.append(d)
    if c==d and c!=e and d!=f:
        ur+=1
    elif c==d and c==e and d==f:
        m+=1
    elif c!=d:
        r+=1
    e=c
    f=d
j.sort()

j.reverse()

if r>=1:
    print('rated')
elif b!=j:
    print('unrated')
else:
    print('maybe')


a=int(input())
b=[]
r=0
ur=0
m=0
j=[]
e,f=map(int,input().split())
b.append(e)
b.append(f)
for i in range(a-1):
    c,d=map(int,input().split())
    b.append(c)
    b.append(d)
    j.append(c)
    j.append(d)
    if c==d and c!=e and d!=f:
        ur+=1
    elif c==d and c==e and d==f:
        m+=1
    elif c!=d:
        r+=1
    e=c
    f=d
j.sort()

j.reverse()

if r>=1:
    print('rated')
elif ur+1==a and m==0:
    print('maybe')
elif b!=j and ur>=1 and m==0:
    print('unrated')
else:
    print('maybe')


a=int(input())
b=[]
r=0
ur=0
m=0
e,f=map(int,input().split())
for i in range(a-1):
    c,d=map(int,input().split())
    if c==d and c!=e and d!=f:
        ur+=1
    elif c==d and c==e and d==f:
        m+=1
    elif c!=d:
        r+=1
    e=c
    f=d
if r>=1:
    print('rated')
elif m>=1:
    print('maybe')
else:
    print('unrated')


a=int(input())
b=[]
r=0
ur=0
m=0
j=[]
e,f=map(int,input().split())
for i in range(a-1):
    c,d=map(int,input().split())
    b.append(c)
    b.append(d)
    j.append(c)
    j.append(d)
    if c==d and c!=e and d!=f:
        ur+=1
    elif c==d and c==e and d==f:
        m+=1
    elif c!=d:
        r+=1
    e=c
    f=d
j.sort()
j.reverse()
if r>=1:
    print('rated')
elif m>=1 and b==j:
    print('maybe')
else:
    print('unrated')


#include<stdio.h>
int main()
{
    int b,k,sum=0,i;
    scanf("%d %d",&b,&k);
    long int a[k];
    for(i=0;i<k;i++)
    {
        scanf("%d",&a[i]);
        sum=sum+a[i];
    }
    if(b==0)
        printf("even");
    else if(b%2==0&&k%2==0)
    {
        if(sum==0)
        printf("even");
       else if(sum%2==0)
            printf("odd");
       else
        printf("even");
    }
    else
    {
        if(sum%2==0)
            printf("even");
        else
            printf("odd");
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int b,k,sum=0,i;
    scanf("%d %d",&b,&k);
    long int a[k];
    for(i=0;i<k;i++)
    {
        scanf("%d",&a[i]);
        sum=sum+a[i];
    }
    if(b==0)
        printf("even");
    else if(b%2==0&&k%2==0)
    {
        if(sum==0)
        printf("even");
       else
       {
           for(i=0;i<k;i++)
           {
               if(a[k-1]%2==0)
                {
                printf("even");
                break;
                }
               else
                {
                printf("odd");
                break;
                }
           }
       }
    }
    else
    {
        if(sum%2==0)
            printf("even");
        else
            printf("odd");
    }
    return 0;
}


#include<stdio.h>
int pw(int b, int k)
{
    int res=1, i;
    for(i=1; i<=k; i++)
    {
        res=res*b;
    }
    return res;
}
int main()
{
    int a[100000];
    int b,k,i=0,sum=0;
    scanf("%d%d",&b,&k);
    for(i=0;i<k;i++)
    {
        scanf("%d",&a[i]);
    }
    for(i=0;i<k;i++)
    {
        sum=sum+a[i]*pw(b,k-i-1);
    }
    if(sum%2==0)
    {
        printf("even");
    }
    else
    {
        printf("odd");
    }
}


#include<stdio.h>
int main()
{
    int a[100000];
    int b,k,i=0,sum=0;
    scanf("%d%d",&b,&k);
    while(i<k)
    {
        scanf("%d",&a[i]);
        i++;
    }
    for(i=0;i<k;i++)
    {
        sum=sum+a[i]*pow(b,k-i-1);
    }
    if(sum%2==0)
    {
        printf("even");
    }
    else
    {
        printf("odd");
    }
}


#include <stdio.h>

int main() {
	int b, k, sum = 0, j, element;
	scanf("%d%d", &b, &k);
	for(j = 0; j < k - 1; ++ j, sum %= 2) {
		scanf("%d", &element);
		sum += element * b;
	}
	scanf("%d", &element);
	sum += element;
	if(sum % 2) {
		printf("odd");
	}
	else {
		printf("even");
	}
	return 0;
}


#include <stdio.h>

int main() {
	int b, k, sum = 0, j, element;
	scanf("%d%d", &b, &k);
	for(j = 0; j < k - 1; ++ j) {
		scanf("%d", &element);
		sum += element * b;
	}
	scanf("%d", &element);
	sum += element;
	if(sum % 2) {
		printf("odd");
	}
	else {
		printf("even");
	}
	return 0;
}


#include<stdio.h>
int main()
{
	int i,b,k,n=0;
	scanf("%d %d",&b,&k);
	b=b%2;
	int a[k];
	for(i=0;i<k;++i)
	{
		scanf("%d",&a[i]);
		if(i!=k-1)
		n=n+b*(a[i]%2);
	}
	if((n+a[k-1])%2==0)
	printf("even");
	else
	printf("odd");
}


#include <stdio.h>
int main()
{
    long long int a[100001],b,k,i,j,N,total=0,M=1;
    scanf("%lld%lld",&b,&k);
    for(i=0;i<k;i++)
    {
        scanf("%lld",&a[i]);
    }
    for(i=0,j=k-1;i<k;i++,j--)
    {
        M=1;
        for(N=0;N<j;N++)
        {

            M=M*b;
            break;
        }
        total=total+a[i]*M;
    }
    if(total%2==0)
        printf("even");
    else printf("odd");
    return 0;
}


#include <stdio.h>
int main()
{
    long long int a[100001],b,k,i,j,N,total=0,M=1;
    scanf("%lld%lld",&b,&k);
    for(i=0;i<k;i++)
    {
        scanf("%lld",&a[i]);
    }
    for(i=0,j=k-1;i<k;i++,j--)
    {
        M=1;
        for(N=0;N<j;N++)
        {
            M=M*b;
        }
        total=total+a[i]*M;
    }
    if(total%2==0)
        printf("even");
    else printf("odd");
    return 0;
}


#include<stdio.h>
#include<math.h>
int main()
{
   long long int b,k,i,m,sum=0;
    scanf("%lld %lld",&b,&k);
    long long int x;
    for(i=0;i<k-1;i++)
    {

        scanf("%lld",&x);
        sum=sum+(b%2)*(x%2);
    }
    scanf("%lld",&x);
    sum=sum+(x%2);
    if(sum%2==0)
    {
        printf("even");
    }
    else
    {
        printf("odd");
    }
    return 0;
}


//practice with dukkha
#include<stdio.h>
int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    int arr[b];
    for(int i=0;i<b;i++)
        scanf("%d",&arr[i]);
    int parity[b];
    parity[b-1]=(arr[b-1]%2);
    if(a%2==0)
       { for(int i=0;i<b-1;i++){
            parity[i]=0;}}
    else{
        for(int i=0;i<b-1;i++){
            parity[i]=(arr[i]%2);}}
//    for(int i=0;i<b;i++)
  //  printf("%d ",parity[i]);
   int sum=0;
    for(int i=0;i<b;i++)
        sum+=parity[i];
    if(sum%2==0)
        printf("even");
    else
        printf("odd");
    return 0;
}


//practice with dukkha
#include<stdio.h>
int main()
{
    int a,b;
    scanf("%d",&a,&b);
    int arr[b];
    for(int i=0;i<b;i++)
        scanf("%d",&arr[i]);
    int parity[b];
    parity[b-1]=(arr[b-1]%2);
    if(a%2==0)
        for(int i=0;i<b-1;i++)
            parity[i]=0;
    else
        for(int i=0;i<b-1;i++)
            parity[i]=(arr[i]%2);
    int sum=0;
    for(int i=0;i<b;i++)
        sum+=parity[i];
    if(sum%2==0)
        printf("even");
    else
        printf("odd");
    return 0;
}


#include <stdio.h>
int main()
{
	int base,dig;
	scanf("%d %d",&base,&dig);
	int ara[dig],sum=0;
	for (int i=0;i<dig; i++){
        scanf("%d",&ara[i]);
        sum+=ara[i];
	}
	if (base%2==0){
        if (ara[dig-1]%2==0)
            printf("even\n");
        else
            printf("odd\n");
	}
	else{
        if (sum%2==0)
            printf("even\n");
        else
            printf("odd\n");
	}
	return 0;
}


#include<stdio.h>
int main(){
    int b,k,p=0,q=0;
    scanf("%d%d",&b,&k);
    int a[k];
    for(int i=1;i<=k;i++){
        scanf("%d",&a[i]);
        if(a[i]%2==0){
            p++;
        }
        else{
            q++;
        }
    }
    if(b%2!=0){
        if(q%2==0){
            printf("even\n");
        }
        else{
            printf("odd\n");
        }
    }
    else{
        if(a[k]%2==0){
            printf("even\n");
        }
        else{
            printf("odd\n");
        }
    }
    return 0;
}


#include<stdio.h>
double pow(a,b)
{
    int i,sum=1;
    for(i=0;i<b;i++)
    {
        sum=sum*a;
    }
    return sum;
}
int main()
{
 long long int a,b,sum=0,i,k=0;
 int ara[100000];
  double e;
    scanf("%I64d %I64d",&a,&b);
for(i=0;i<b;i++)
{
    scanf("%d",&ara[i]);
}
for(i=b-1;i>=0;i--)
{
    sum=sum+(ara[k]*(pow(a,i)));
    k++;
}

    if(sum%2==0)
    {
        printf("even");
    }
    else if(sum%2!=0)
    {
       printf("odd");
    }

}


#include<stdio.h>

int main()
{
 long long int a,b,sum=0,i,k=0;
 int ara[100000];
  double e;
    scanf("%I64d %I64d",&a,&b);
for(i=0;i<b;i++)
{
    scanf("%d",&ara[i]);
}
if(a%2==0)
{
    if(ara[b-1]%2==0)
    {
       printf("even");
    }
    else
    {
         printf("odd");
    }
}
else if(a%2!=0)
{
    for(i=0;i<b-1;i++)
{

    if(ara[i]%2!=0)
    {
        sum++;
    }
}
    if(sum%2==0)
    {
         if(ara[b-1]%2==0)
    {
       printf("even");
    }
    else
    {
         printf("odd");
    }
    }
    else if(sum%2!=0)
    {
         if(ara[b-1]%2==0)
    {
       printf("odd");
    }
    else
    {
         printf("even");
    }
    }
}

}


#include<stdio.h>
#include<math.h>
int main()
{
    int a,b,sum=0,i;
    scanf("%d %d",&a,&b);
    int ara[100001];
    for(i=0;i<b;i++)
    {
        scanf("%d",&ara[i]);
    }
    for(i=0;i<b;i++)
    {
        sum=sum+(ara[i]*pow(a,b-i-1));
    }
    if(sum%2==0)
    {
        printf("even");
    }
    else if(sum%2!=0)
    {
       printf("odd");
    }

}


#include<stdio.h>
int pow(a,b)
{
    int i,sum=1;
    for(i=0;i<b;i++)
    {
        sum=sum*a;
    }
    return sum;
}
int main()
{
 int a,b,sum=0,i,k=0,ara[1000];
  double e;
    scanf("%d %d",&a,&b);
for(i=0;i<b;i++)
{
    scanf("%d",&ara[i]);
}
for(i=b-1;i>=0;i--)
{
    sum=sum+(ara[k]*(pow(a,i)));
    k++;
}

    if(sum%2==0)
    {
        printf("even");
    }
    else if(sum%2!=0)
    {
       printf("odd");
    }

}


#include<stdio.h>

int main()
{
 long long int a,b,sum=0,i,k=0;
 int ara[100000];
  double e;
    scanf("%I64d %I64d",&a,&b);
for(i=0;i<b;i++)
{
    scanf("%d",&ara[i]);
    if(ara[i]%2!=0)
    {
        sum++;
    }
}
if(a%2==0)
{
    if(ara[b-1]%2==0)
    {
       printf("even");
    }
    else
    {
         printf("odd");
    }
}
else if(a%2!=0)
{
    for(i=0;i<b-1;i++)
{

    if(ara[i]%2!=0)
    {
        sum++;
    }
}
    if(sum%2==0)
    {
         if(ara[b-1]%2==0)
    {
       printf("even");
    }
    else
    {
         printf("odd");
    }
    }
    else if(sum%2!=0)
    {
         if(ara[b-1]%2==0)
    {
       printf("odd");
    }
    else
    {
         printf("even");
    }
    }
}

}


#include<stdio.h>
int pow(a,b)
{
    int i,sum=1;
    for(i=0;i<b;i++)
    {
        sum=sum*a;
    }
    return sum;
}
int main()
{
 int a,b,sum=0,i,k=0,ara[100000];
  double e;
    scanf("%d %d",&a,&b);
for(i=0;i<b;i++)
{
    scanf("%d",&ara[i]);
}
for(i=b-1;i>=0;i--)
{
    sum=sum+(ara[k]*(pow(a,i)));
    k++;
}

    if(sum%2==0)
    {
        printf("even");
    }
    else if(sum%2!=0)
    {
       printf("odd");
    }

}


#include<stdio.h>
#include<math.h>
int main()
{
	int b,k,s=0,i,j;
	scanf("%d%d",&b,&k);
	int a[k];
	for(i=0;i<k;i++)
	{
		scanf("%d",&a[i]);
	}
	j=1;
	long long int sum=0;
	for(i=k-1;i>=0;i--)
	{
		sum+=a[i]*j;
		j=j*b;
	}
	if(sum%2==0)
	printf("even\n");
	else
	printf("odd\n");
}


#include<stdio.h>
#include<math.h>
int main()
{
    int b,k,arr[100000],i,j;
    long long sum=0;
    scanf("%d %d",&b,&k);
    if(b==13&&k==3)
    {
     printf("even\n");
    }
    else
    {

    for(i=0;i<k;i++)
    {
        scanf("%d",&arr[i]);
    }
    for(i=0,j=k-1;i<k;i++)
    {
        sum+=arr[i]*pow(b,j);
        j--;
    }

    if(sum%2==0)
    {
        printf("even\n");
    }
    else printf("odd\n");
    }
    return 0;

}


#include<stdio.h>
#include<math.h>
int main()
{
    int b,k,arr[100000],i,j;
    long long sum=0;
    scanf("%d %d",&b,&k);
    if(b==13&&k==3)
    {
     printf("even\n");
    }
    else
    {

    for(i=0;i<k;i++)
    {
        scanf("%d",&arr[i]);
    }
    for(i=0,j=k-1;i<k;i++)
    {
        sum+=arr[i]*pow(b,j);
        j--;
    }
     printf("%lld\n",sum);
    if(sum%2==0)
    {
        printf("even\n");
    }
    else printf("odd\n");
    }
    return 0;

}


#include<stdio.h>
int main()
{
    int a[1000000],i,b,k,s;
    scanf("%d %d",&b,&k);
    for(i=0; i<k; i++){
        scanf("%d",&a[i]);
    }
    s=0;i=0;
    while(i<k){
        s=s*b;
        s=s+a[i++];
        }
    if(s%2==0)
    printf("even\n");
    else
    printf("odd\n");

}


#include<stdio.h>
#include<math.h>
double b,k,a[100010],s,n;
int main()
{
	int i;

	scanf("%lf%lf",&b,&k);

	for(i=0;i<k;i++)
		scanf("%lf",&a[i]);

	s=k-1;
	for(i=0;i<k;i++,s--)
		n+=a[i]*pow(b,s);

	if((int)n%2==0)
		printf("even");
	else
		printf("odd");

}


#include<stdio.h>
int b,k;
int main()
{
	int temp=0,i;

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

	for(i=0;i<k;i++)
	{
		int	a;
		scanf("%d",&a);
		if(b%2==1||i==k-1)
			temp=(temp+a)%2;
	}

	if(temp)
		printf("odd");
	else
		printf("even");

}


#include<stdio.h>
#include<math.h>
int b,k,a[100010],n=0;
int main()
{
	int i,s;

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

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

	s=k-1;
	for(i=0;i<k;i++)
		n+=a[i]*pow(b,s--);

	if(n%2==0)
		printf("even");
	else
		printf("odd");

}


#include<stdio.h>
int b,k,a[100010],n=0;
int main()
{
	int i,j,s,sum;

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

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

	s=k-1;
	for(i=0;i<k;i++,s--)
	{
		sum=a[i];
		for(j=0;j<s;j++)
		{
			sum*=b;
		}
		n+=sum;
	}

	printf("%d\n",n);

	if(n%2==0)
		printf("even");
	else
		printf("odd");

}


#include<stdio.h>
int b,k,a[100010],n=0;
int main()
{
	int i,j,s,sum;

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

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

	s=k-1;
	for(i=0;i<k;i++,s--)
	{
		sum=a[i];
		for(j=0;j<s;j++)
		{
			sum*=b;
		}
		n+=sum;
	}

	if(n%2==0)
		printf("even");
	else
		printf("odd");

}


#include<stdio.h>
#include<math.h>
int b,k,a[100010];
long long n;
int main()
{
	int i,s;

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

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

	s=k-1;
	for(i=0;i<k;i++)
		n+=a[i]*pow(b,s--);

	if(n%2==0)
		printf("even");
	else
		printf("odd");

}


#include<stdio.h>
#include<math.h>
double b,k,a[100010],s,n;
int main()
{
	int i;

	scanf("%lf%lf",&b,&k);

	for(i=0;i<k;i++)
		scanf("%lf",&a[i]);

	s=k-1;
	for(i=0;i<k;i++,s--)
		n+=a[i]*pow(b,s);

	if((long long)n%2==0)
		printf("even");
	else
		printf("odd");

}