#include <bits/stdc++.h>
using namespace std;
struct _Reader {
  _Reader(istream &cin) : cin(cin) {}
  istream &cin;
  template <class T>
  _Reader operator,(T &rhs) {
    cin >> rhs;
    return *this;
  }
};
struct _Writer {
  _Writer(ostream &cout) : cout(cout) {}
  ostream &cout;
  bool f{false};
  template <class T>
  _Writer operator,(const T &rhs) {
    cout << (f ? " " : "") << rhs;
    f = true;
    return *this;
  }
};
template <class T>
struct vevector : public vector<vector<T>> {
  vevector(size_t n = 0, size_t m = 0, const T &initial = T())
      : vector<vector<T>>(n, vector<T>(m, initial)) {}
};
template <class T>
struct vevevector : public vector<vevector<T>> {
  vevevector(size_t n = 0, size_t m = 0, size_t l = 0, const T &initial = T())
      : vector<vevector<T>>(n, vevector<T>(m, l, initial)) {}
};
template <class T>
struct vevevevector : public vector<vevevector<T>> {
  vevevevector(size_t n = 0, size_t m = 0, size_t l = 0, size_t k = 0,
               const T &initial = T())
      : vector<vevevector<T>>(n, vevevector<T>(m, l, k, initial)) {}
};
namespace std {
template <class T1, class T2>
inline istream &operator>>(istream &in, pair<T1, T2> &p) {
  in >> p.first >> p.second;
  return in;
}
template <class T1, class T2>
inline ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << p.first << " " << p.second;
  return out;
}
}  // namespace std
template <class T>
T read() {
  T t;
  cin >> t;
  return t;
}
template <class T>
vector<T> read(int n) {
  vector<T> v;
  for (int i = 0; i < (n); i++) {
    v.push_back(read<T>());
  }
  return v;
}
template <class T>
vevector<T> read(int n, int m) {
  vevector<T> v;
  for (int i = 0; i < (n); i++) v.push_back(read<T>(m));
  return v;
}
template <class T>
vector<T> readjag() {
  return read<T>(read<int>());
}
template <class T>
vevector<T> readjag(int n) {
  vevector<T> v;
  for (int i = 0; i < (n); i++) v.push_back(readjag<T>());
  return v;
}
template <class T>
struct iter_pair_t {
  T beg, end;
};
template <class T>
iter_pair_t<T> iter_pair(T beg, T end) {
  return iter_pair_t<T>{beg, end};
}
template <class T>
ostream &operator<<(ostream &out, iter_pair_t<T> v) {
  if (v.beg != v.end) {
    out << *v.beg++;
    while (v.beg != v.end) {
      out << " " << *v.beg++;
    }
  }
  return out;
}
template <class T1>
ostream &operator<<(ostream &out, const vector<T1> &v) {
  return out << iter_pair(begin(v), end(v));
}
template <class T>
T infinity_value();
template <>
constexpr int infinity_value<int>() {
  return (1 << 28);
};
template <>
constexpr unsigned int infinity_value<unsigned int>() {
  return (1u << 28);
};
template <>
constexpr long long infinity_value<long long>() {
  return (1ll << 60);
};
template <>
constexpr unsigned long long infinity_value<unsigned long long>() {
  return (1ull << 60);
};
template <>
constexpr double infinity_value<double>() {
  return (HUGE_VAL);
};
template <>
constexpr float infinity_value<float>() {
  return (HUGE_VAL);
};
inline int sign_of(double x) { return (abs(x) < 1e-9 ? 0 : x > 0 ? 1 : -1); }
template <class TInt>
bool in_range(TInt val, TInt min, TInt max) {
  return val >= min && val < max;
}
template <>
bool in_range<double>(double val, double min, double max) {
  return val - min > -1e-9 && val - max < 1e-9;
}
template <>
bool in_range<float>(float val, float min, float max) {
  return val - min > -1e-9 && val - max < 1e-9;
}
template <class TInt>
bool in_range2d(TInt x, TInt y, TInt w, TInt h) {
  return x >= 0 && x < w && y >= 0 && y < h;
}
vector<int> iotavn(int start, int count) {
  vector<int> r(count);
  iota(r.begin(), r.end(), start);
  return r;
}
void solve();
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed;
  cout << setprecision(std::numeric_limits<double>::max_digits10);
  solve();
  return 0;
}
void solve() {
  long long N, X;
  (_Reader{cin}), N, X;
  auto A = read<long long>(N);
  std::sort(A.begin(), A.end());
  std::map<long long, int> ans;
  ans[X] = 0;
  int result = 0;
  for (int i = 0; i < (N); i++) {
    std::map<long long, int> next = ans;
    for (auto &p : ans) {
      int nxt = p.first - A[i];
      if (nxt >= 0) {
        next[nxt] = std::max(next[nxt], p.second + 1);
        result = max(result, p.second);
      }
    }
    ans.swap(next);
  }
  (_Writer{cout}), max(ans[0], result);
  cout << '\n';
}
