#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
map<long long, int> memo;
const int MAX_N = 100;
int N;
long long x;
long long A[MAX_N];
int solve() {
  int answer = 0;
  sort(A, A + N);
  for (int i = (0); i < (N); i++) {
    map<long long, int> memo_copy;
    for (pair<long long, int> p : memo) {
      if (memo.find(p.first + A[i]) == memo.end() ||
          memo[p.first + A[i]] < p.second + 1) {
        memo_copy[p.first + A[i]] = p.second + 1;
      }
    }
    for (pair<long long, int> p : memo_copy) {
      memo[p.first] = p.second;
    }
    if (memo.find(A[i]) == memo.end()) memo[A[i]] = 1;
  }
  for (pair<long long, int> p : memo) {
    if (p.first == x) {
      answer = max(p.second, answer);
    } else if (p.first < x) {
      answer = max(p.second - 1, answer);
    }
  }
  return answer;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> x;
  for (int i = (0); i < (N); i++) cin >> A[i];
  cout << solve() << "\n";
  return 0;
}
