/*---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

// #define kyoa_a
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define rrep(a, b, c)  for(int a = (b); a > c; --a)
#define each(a, b)     for(auto& a : b)

#define sz(x)       (int)(x).size()
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(), (a).rend()

#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define f first
#define s second
#define dbg(x) cout << #x << " = " << x << endl;
#define vt vector
#define ar array
#define pii pair<int, int>
#define vi vector<int>
#define pll pair<ll, ll>
#define pct(x) __builtin_popcount(x)
#define fbo(x) find_by_order(x)
#define ook(x) order_of_key(x)
#define rsz resize

constexpr int log2(int x) { return x == 0 ? 0 : 31-__builtin_clz(x); } // floor(log2(x))

template <typename T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <class T> bool umin(T& a, const T& b){
	return b<a?a=b, 1:0;
}
template <class T> bool umax(T& a, const T& b){
	return a<b?a=b, 1:0;
}

using ll = long long;
using ld = long double;
using str = string;

const int inf = (int)1e9 + 5;
const ll infl = (ll)1e18 + 5;
const int mod = 1e9 + 7;
const int N = 55;
const int A = 911382323;
const int B = 972663749;

const int d4i[4]={-1, 0, 1, 0}, d4j[4]={0, 1, 0, -1};
const int d8i[8]={-1, -1, 0, 1, 1, 1, 0, -1}, d8j[8]={0, 1, 1, 1, 0, -1, -1, -1};

/*---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---XXX---*/

vt<int> p;
vt<ll> al;

int n, a[N], fi;

void solve(){
	rep(i, 2, 51){
		bool ok = 1;
		for(int j = 2; j*j <= i; ++j){
			if(i%j == 0){
				ok = 0;
				break;
			}
		}
		if(ok) p.eb(i);
	}
	fi = 1<<sz(p);
	rep(i, 1, fi){
		ll ans = 1;
		rep(j, 0, sz(p)){
			if(i&(1<<j)) ans *= p[j];
		}
		al.eb(ans);
	}
	sort(all(al));
	cin >> n;
	rep(i, 0, n) cin >> a[i];
	each(x, al){
		bool ok = 1;
		rep(i, 0, n){
			if(__gcd(x, (ll)a[i]) == 1){
				ok = 0;
				break;
			}
		}
		if(ok){
			cout << x << '\n';
			return;
		}
	}

}


int main(){
	#ifdef kyoa_a
		auto begin = std::chrono::high_resolution_clock::now();
	#endif

	ios::sync_with_stdio(false);
	cin.tie(nullptr);
		solve();

	#ifdef kyoa_a
		auto end = std::chrono::high_resolution_clock::now();
		cout << setprecision(3) << fixed;
		cout << "Execution time: " << std::chrono::duration_cast<std::chrono::duration<double>>(end - begin).count() << " seconds" << endl;
	#endif
}
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int nax=5005,mod=998244353;
int dp[15][nax],f[nax],invf[nax],pw[30];
int mul(int x,int y)
{
    return x*y%mod;
}
int nck(int n,int r)
{
    if(r<0 || r>n)
	return 0;
	return (f[n]*invf[n-r]%mod*invf[r]%mod);
}
int expo(int a,int b)
{
    int res=1;
	while(b>0)
	{
	    if(b%2==1)
	    res=mul(res,a);
	    a=mul(a,a);
	    b>>=1;
	}
	return res;
}
int inv(int x)
{
    return expo(x,mod-2);
}
void init()
{
    f[0]=1;
	for(int i=1;i<nax;i++)
	f[i]=(f[i-1]*i)%mod;
	invf[nax-1]=inv(f[nax-1]);
	for(int i=nax-2;i>=0;i--)
	invf[i]=(invf[i+1]*(i+1))%mod;
}
int n;
int dfs(int pos,int val)
{
    if(val&pw[pos])
    return 0;
    if(~dp[pos][val])
    return dp[pos][val];
    if(pos==13)
    {
        if(val)
        return 0;
        return 1;
    }
    int res=0;
    for(int i=0;pw[pos]*i<=val;i+=2)
    res=(res+mul(nck(n,i),dfs(pos+1,val-pw[pos]*i)))%mod;
    return dp[pos][val]=res;
}
int32_t main()
{
    init();
    memset(dp,-1,sizeof(dp));
    int m;
    cin>>n>>m;
    pw[0]=1;
    for(int i=1;i<30;i++)
    pw[i]=mul(pw[i-1],2LL);
    cout<<dfs(0,m);
    return 0;
}