import sys input = sys.stdin.readline N,K=map(int,input().split()) A=list(map(int,input().split())) A=[a-K for a in A] DP=[0]*20010 DP[10005]=1 import copy for a in A: NDP=copy.deepcopy(DP) for i in range(20010): if 0<=i+a<20010: NDP[i+a]+=DP[i] NDP[i+a]%=(10**9+7) DP=NDP print((sum(DP[10005:])-1)%(10**9+7))