#include using namespace std; typedef long long ll; const ll mod = pow(10, 9) + 7; const int l = 2 * 100 * 100; const int m = 100 * 100; ll dp[101][l + 1]{}; int main() { int N, K; cin >> N >> K; ll A[N]; for (int i = 0; i < N; i++) { cin >> A[i]; A[i] -= K; } dp[0][m] = 1; for (int i = 0; i < N; i++) { for (int j = 0; j < l; j++) { if (dp[i][j] == 0) continue; dp[i + 1][j] += dp[i][j]; dp[i + 1][j] %= mod; if (j + A[i] < 0 || j + A[i] >= l) continue; dp[i + 1][j + A[i]] += dp[i][j]; dp[i + 1][j + A[i]] %= mod; } } ll s = 0; for (int i = m; i < l; i++) { s += dp[N][i]; s %= mod; } cout << s - 1<< "\n"; return 0; }