#include <bits/stdc++.h>
const int M = 50 * 50 + 1;
const int MOD = (int)1e9 + 7;
int ways[M + M];
void update(int& x, int a) {
  x += a;
  if (x >= MOD) {
    x -= MOD;
  }
}
int main() {
  int n, a;
  scanf("%d%d", &n, &a);
  ways[M] = 1;
  for (int i = 0, x; i < n; ++i) {
    scanf("%d", &x);
    x -= a;
    if (x >= 0) {
      for (int j = M + M - 1; j >= x; --j) {
        update(ways[j], ways[j - x]);
      }
    } else {
      for (int j = 0; j - x < M + M; ++j) {
        update(ways[j], ways[j - x]);
      }
    }
  }
  update(ways[M], MOD - 1);
  printf("%d\n", ways[M]);
}
