using System;
using System.Collections.Generic;
class Solve{
    public int N;
    public int[] x;
    public Solve(){}
    public static int Main(){
        new Solve().Calc();
        return 0;
    }
    void Calc(){
        getinput();
        long ans = 0;
        long[] nm1 = new long[2500];
        long[] m1 = new long[2500]; 
        long[] nm2 = new long[2500];
        long[] m2 = new long[2500];
        for(int i=0;i<2500;i++){
            nm1[i] = 0;
            m1[i] = 0;
            nm2[i] = 0;
            m2[i] = 0;
        }
        {
            int j = N/2;
            long k = 1 << j;
            for(int i=1;i<k;i++){
                int sum = 0;
                for(int l = 0;l<j;l++){
                    if(((1 << l) & i) != 0){
                        sum += x[l];
                    }
                }
                if(sum >= 0){
                    nm1[sum]++;
                }
                else{
                    m1[-sum]++;
                }
            } 
        }
        {
            int j = N-N/2;
            long k = 1 << j;
            for(int i=1;i<k;i++){
                int sum = 0;
                for(int l = 0;l<j;l++){
                    if(((1 << l) & i) != 0){
                        sum += x[l+N/2];
                    }
                }
                if(sum >= 0){
                    nm2[sum]++;
                }
                else{
                    m2[-sum]++;
                }
            } 
        }
        ans += nm1[0]+nm2[0]+nm1[0]*nm2[0];
        for(int i=1;i<2500;i++){
            ans+=nm1[i]*m2[i]+m1[i]*nm2[i];
        }
        Console.WriteLine(ans);
    }
    void getinput(){
        string[] str = Console.ReadLine().Split(' ');
        N = int.Parse(str[0]);
        int A = int.Parse(str[1]);
        str = Console.ReadLine().Split(' ');
        x = new int[N];
        for(int i=0;i < N;i++){
            x[i] = int.Parse(str[i])-A;
        }
    }    
}