#include <bits/stdc++.h>
//#include <bits/extc++.h>
//#define int long long
#define ll long long
#define ull unsigned ll
#define endl "\n"
#define pb push_back
#define ms(v,x) memset(v,x,sizeof(v))
#define ff first
#define ss second
#define td(v) v.begin(),v.end()
#define rep(i,a,n) for (int i=(a);i<(n);i++)
#define per(i,a,n) for (int i=(n-1);i>=a;i--)
#define trav(a, x) for(auto& a : x)
#define re(v) {for(auto &_re : v) cin >> _re;}
#define pr(v) {for(auto _pr : v) cout << _pr << " "; cout << endl;}
#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define eb emplace_back
using namespace std;
using vvi = vector<vi>;
using vvl = vector<vl>;
//const ll M = 1e9 + 7;
//const ll M = 998244353;
const ll M = 1e9 + 9;
//const ll M = 1e6;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll binpow(ll a, ll b){
	ll res = (a!=0);
	while(b > 0){
		if(b&1) res = res * a % M;
		a = a * a % M;
		b>>=1;
	}
	return res;
}
const ll inf = 2e18;
void solve(){
	ll n, x;
	cin >> n >> x;
	vl a(n);
	re(a);
	ll ans = -1;
	for(int i=1;i<=n;i++){
		// biggest sum such that (x - s) % i == 0
		vector<vl> dp(i, vl(i + 1, -inf));
		dp[0][0] = 0;
		for(int j=0;j<n;j++){
			vector<vl> new_dp = dp;
			for(int k=0;k<i;k++){
				for(int z=0;z<i;z++){
					if(dp[k][z] != -inf){
						new_dp[(a[j] + k) % i][z + 1] = max(new_dp[(a[j] + k) % i][z + 1], dp[k][z] + a[j]);
					}
				}
			}
			swap(dp, new_dp);
		}
		if(dp[x%i][i] == -inf) continue;
		if(ans == -1){
			ans = (x - dp[x%i][i]) / i;
		}
		else ans = min(ans, (x - dp[x%i][i]) / i);
	}
	cout << ans << endl;
}	
int32_t main(){
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  //freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);	
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
}
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include <chrono>
#include <random>
#include <unordered_set>

using namespace std;

typedef long long ll;

void solve() {
    ll a, b;
    cin >> a >> b;
    int n = 73;
    vector<int> s(n);
    vector<int> prime;
    for (int i = 2; i < n; i++) {
        if (s[i] == 0) {
            s[i] = i;
            prime.emplace_back(i);
            for (int j = i; j < n; j += i) {
                s[j] = i;
            }
        }
    }

    int m = b - a + 1;
    n = prime.size();
    vector<int> mask(m);

    for (int i = 0; i < m; i++) {
        ll x = a + i;
        for (int j = 0; j < n; j++) {
            if (x % prime[j] == 0) {
                mask[i] ^= (1 << j);
            }
        }
    }

    vector<ll> dp(1 << n);
    dp[0] = 1;

    for (int i = 0; i < m; i++) {
        vector<ll> dp2(1 << n);
        for (int j = 0; j < (1 << n); j++) {
            if (dp[j] == 0)
                continue;
            dp2[j] += dp[j];
            if ((mask[i] & j) == 0)
                dp2[mask[i] ^ j] += dp[j];
        }
        dp.swap(dp2);
    }

    ll ans = 0;
    for (int i = 0; i < (1 << n); i++) {
        ans += dp[i];
    }

    cout << ans;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#if defined(_DEBUG)
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int q = 1;
    //cin >> q;
    for (; q > 0; q--) {
        solve();
        //cout << endl;
    }
}