#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>

using namespace std;

int main()
{
    int N, A;
    std::cin >> N >> A;

    std::vector<int> X;
    for (size_t i = 0; i < N; ++i) {
        int t;
        std::cin >> t;
        X.push_back(t - A);
    }

    boost::multi_array<size_t, 2> memo(boost::extents[N+1][N*50+2]);

    std::fill(memo.data(), memo.data() + memo.num_elements(), -1);

    auto f = [&memo, &X, N](auto F, size_t i, int sum) -> size_t  {
        if (memo[i][sum + N*25+1] != -1) {
            return memo[i][sum + N*25+1];
        } 
        if (i == N) {
            return 0;
        }
        size_t ret = 0;
        if (sum + X[i] == 0) {
            ret++;
        }

        return memo[i][sum + N*25+1] = ret + F(F, i+1, sum+X[i]) + F(F, i+1, sum);
    };

    auto count = f(f, 0, 0);

    std::cout << count << std::endl;

    return 0;
}
