#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, x;
  int a[100];
  cin >> N >> x;
  for (int i = (0); i < (N); ++i) {
    cin >> a[i];
  }
  sort(a, a + N);
  int nokori = x;
  int cnt = 0;
  bool choudo = false;
  for (int i = (0); i < (N); ++i) {
    int tmp = nokori - a[i];
    if (tmp == 0) {
      nokori = tmp;
      cnt++;
      choudo = true;
      break;
    } else if (tmp > 0) {
      nokori = tmp;
      cnt++;
    } else
      break;
  }
  if (!choudo) cnt--;
  if (cnt < 0) cnt = 0;
  cout << cnt << endl;
  return 0;
}
