/*               ______  ______
 \      / |\   |    |    |       |    |  |   |
  \    /  | \  |    |    |____   |____|  |___|
   \  /   |  \ |    |        |   |    |  |   |
    \/    |   \|    |   _____|   |    |  |   |

  -----------IIT Indore----------*/
#include<bits/stdc++.h>
#define rep(i,start,lim) for(long long i=start;i<lim;i++)
#define repd(i,start,lim) for(long long i=start;i>=lim;i--)
#define scan(x) scanf("%lld",&x)
#define print(x) printf("%lld ",x)
#define sz(a) lld((a).size())
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define YES printf("YES\n")
#define NO printf("NO\n")
#define all(c) (c).begin(),(c).end()
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define tr(it,c) for(__typeof(c.begin()) it = c.begin(); it!=c.end(); ++it)
#define br printf("\n")
#define checkbit(n,b) ((n>>b)&1)
#define TRACE
#ifdef TRACE
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#else
#define trace1(x)                printf("")
#define trace2(x, y)             printf("")
#define trace3(x, y, z)          printf("")
#define trace4(a, b, c, d)       printf("")
#define trace5(a, b, c, d, e)    printf("")
#define trace6(a, b, c, d, e, f) printf("")
#endif
#define INF         1011111111
#define LLINF       1000111000111000111LL
#define EPS         (double)1e-10
#define MOD         1000000007
#define PI          3.14159265358979323
using namespace std;
typedef long double ldb;
typedef long long lld;
lld powm(lld base,lld exp,lld mod=MOD) {lld ans=1;while(exp){if(exp&1) ans=(ans*base)%mod;exp>>=1,base=(base*base)%mod;}return ans;}
typedef vector<lld> vlld;
typedef pair<lld,lld> plld;
typedef map<lld,lld> mlld;
typedef set<lld> slld;
inline lld lcm(lld a,lld b){ return (a/__gcd(a, b))*b; }
template<typename T1, typename T2> inline pair<T1, T2> operator+(const pair<T1, T2> &p1 , const pair<T1, T2> &p2) { return pair<T1, T2>(p1.first + p2.first, p1.second + p2.second); }
template<typename T1, typename T2> inline pair<T1, T2> operator-(const pair<T1, T2> &p1 , const pair<T1, T2> &p2) { return pair<T1, T2>(p1.first - p2.first, p1.second - p2.second); }
#define DA(a,n) cout<<#a<<"=["; printarray(a,n); cout<<"]\n"
#define DAR(a,n,s) cout<<#a<<"["<<s<<"-"<<n-1<<"]=["; printarray(a,n,s); cout<<"]\n"
template<typename T, typename T2>void printarray(T a[], T2 sz, T2 beg = 0){ for (T2 i = beg; i<sz; i++) cout << a[i] << " "; }
#define N 55
lld dp[N][N*N][N];
lld a[N];
int main()
{
	lld n,avg,ans=0;
	scan(n),scan(avg);
	rep(i,1,n+1) scan(a[i]);
//	dp[0][0][0]=1;
	rep(i,1,n+1){
		dp[i][a[i]][1]=1;
	}
//	dp[0][0][0]=1;
	rep(i,1,n+1)
	{
		rep(j,0,N*N+5)
		{
			rep(k,0,n+1)
			{
				if(dp[i-1][j][k] and j+a[i]<N*N) 
				{ 
					dp[i][j+a[i]][k+1]+=dp[i-1][j][k];
					dp[i][j][k]+=dp[i-1][j][k];
				}
			}
		}
	}
	/*rep(i,0,n+1){
		rep(j,0,N*N+ 5){
			rep(k,0,n+1){
				//if(dp[i][j][k] && j==23)cout<<i<<
				if(dp[i][j][k])cout<<i<<" "<<j<< " "<<k<<" "<<dp[i][j][k]<<" ",
					cout<<endl;
			}
		
		}
		//cout<<endl<<endl;
		
	}*/
	rep(i,0,N*N+5) rep(j,0,n+1) 
		if(dp[n][i][j] and j!=0 and (i%j)==0 and (i/j)==avg)
			ans+=dp[n][i][j];
	print(ans);
	return 0;
}




Measured memory_bytes: 14336