import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(max(1000, 10**9)) write = lambda x: sys.stdout.write(x+"\n") n,k = list(map(int, input().split())) a = list(map(int, input().split())) a = [item-k for item in a] ma = sum([-item for item in a if item<0]) Ma = sum([item for item in a if item>0]) dp = [0]*(ma+Ma+10) dp[ma] = 1 M = 10**9+7 for i in range(n): ndp = [0]*(ma+Ma+10) for j in range(ma+Ma+10): ndp[j] = dp[j] if 0<=j-a[i]