#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.push_back(x);
  return v;
}
void err(vector<string>::iterator) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << ", ";
  err(++it, args...);
}
const int N = 1e5 + 10;
int T;
int dp[N];
int a[111];
int n, k;
int main() {
  while (cin >> n >> k) {
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    memset(dp, 0, sizeof(dp));
    for (int i = 1; i <= k; i++) {
      unordered_set<int> st;
      for (int j = 1; j <= n; j++) {
        if (a[j] > i) {
          break;
        }
        st.insert(dp[i - a[j]]);
      }
      for (int j = 0; j <= 110; j++) {
        if (st.find(j) == st.end()) {
          dp[i] = j;
          break;
        }
      }
    }
    cout << dp[k] << endl;
  }
  return 0;
}
