#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vv = vector<vi>;
using vvv= vector<vv>;
using P  = pair<ll, int>;

const ll INF = 1e15;
ll dp[101][101];

int main(){
    int n; ll x;
    cin >> n >> x;
    vi a(n);
    rep(i,n)cin >> a[i];
    
    ll ans = 2e18;
    
    
    for(int k=1; k<=n; k++){
        //dp[j][c]:
        //i個目まで見てj種類使ってて
        //kで割った余りがcなものの中で
        //魔力の総和の最大値
        rep(i,101)rep(j,101)dp[i][j] = -INF;
        dp[0][0] = 0;
        rep(i,n)for(int j=i; j>=0; j--)rep(c,k){
            chmax( dp[j+1][(c+a[i])%k], dp[j][c]+a[i] );
        }
        //rep(c,k)cout << dp[k][c] << endl;
        //cout << endl;
        if(dp[k][x%k] > 0)chmin(ans, (x - dp[k][x%k])/k);
    }
    
    cout << ans << endl;
    
    return 0;
}
#include <bits/stdc++.h>

using namespace std;

std::ostream&
operator<<( std::ostream& dest, __int128_t value )
{
    std::ostream::sentry s( dest );
    if ( s ) {
        __uint128_t tmp = value < 0 ? -value : value;
        char buffer[ 128 ];
        char* d = std::end( buffer );
        do
        {
            -- d;
            *d = "0123456789"[ tmp % 10 ];
            tmp /= 10;
        } while ( tmp != 0 );
        if ( value < 0 ) {
            -- d;
            *d = '-';
        }
        int len = std::end( buffer ) - d;
        if ( dest.rdbuf()->sputn( d, len ) != len ) {
            dest.setstate( std::ios_base::badbit );
        }
    }
    return dest;
}

__int128 gcd(__int128 a, __int128 b)
{
    if (b == 0)
    {
        return a;
    }
    return gcd(b, a % b);
}
int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    long long int t;
    vector <__int128> v;
    vector <__int128> p = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 };
    cin >> n;

    for (int i = 0; i < n; i++)
    {
        cin >> t;
        v.push_back(t);
    }
    
    __int128 res = 1e20;
    int m = p.size();

    for (int i = 0; i < (1 << m); i++)
    {
        __int128 val = 1;
        for (int j = 0; j < m; j++)
        {
            if ((i & (1 << j)))
            {
                val *= p[j];
            }
        }
        bool ok = true;
        for (int j = 0; j < n; j++)
        {
            if (gcd(v[j], val) == 1)
            {
                ok = false;
                break;
            }
        }
        if (ok)
        {
            res = min(res, val);
        }
    }

    cout << res << '\n';

    return 0;
}