#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  cin >> n >> x;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int count = 0;
  bool just = false;
  for (int i = 0; i < n; i++) {
    int tmp = x - a[i];
    if (tmp == 0) {
      count++;
      just = true;
      break;
    } else if (tmp < 0) {
      break;
    } else if (tmp > 0) {
      x = tmp;
      count++;
    }
  }
  if (just) {
    cout << max(0, count) << endl;
  } else {
    cout << max(0, count - 1) << endl;
  }
}
