#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, x, xx = 0, minn = 0, cnt = 0;
  cin >> n >> x;
  long a[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    xx += a[i];
    if (a[i] < minn)
      minn = a[i];
    else if (a[i] == x) {
      cnt++;
    }
  }
  if (xx == x)
    cout << n << endl;
  else if (xx < x) {
    cout << (n - 1) << endl;
  } else if (cnt == 0) {
    cout << "0" << endl;
  } else
    cout << cnt << endl;
  return 0;
}
