N, K = map(int, input().split()) A = [int(a) - K for a in input().split()] NE = [-a for a in A if a < 0] PO = [a for a in A if a > 0] ze = A.count(0) M = 10001 POX = [0] * M POX[0] = 1 for a in PO: for i in range(a, M)[::-1]: POX[i] += POX[i-a] NEX = [0] * M NEX[0] = 1 for a in NE: for i in range(a, M)[::-1]: NEX[i] += NEX[i-a] ans = 1 for i in range(1, M): NEX[i] += NEX[i-1] for i in range(1, M): ans += POX[i] * NEX[i] ans *= ze + 1 ans -= 1 print(ans)