#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;

const int MOD = 1e9 + 7;

struct mod_int {
    int val;

    mod_int(long long v = 0) {
        if (v < 0) v = v % MOD + MOD;
        if (v >= MOD) v %= MOD;
        val = v;
    }

    static int mod_inv(int a, int m = MOD) {
        // https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm#Example
        int g = m, r = a, x = 0, y = 1;

        while (r != 0) {
            int q = g / r;
            g %= r; swap(g, r);
            x -= q * y; swap(x, y);
        }

        return x < 0 ? x + m : x;
    }

    explicit operator int() const {
        return val;
    }

    mod_int& operator+=(const mod_int &other) {
        val += other.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }

    mod_int& operator-=(const mod_int &other) {
        val -= other.val;
        if (val < 0) val += MOD;
        return *this;
    }

    static unsigned fast_mod(uint64_t x, unsigned m = MOD) {
#if !defined(_WIN32) || defined(_WIN64)
        return x % m;
#endif
        // Optimized mod for Codeforces 32-bit machines.
        // x must be less than 2^32 * m for this to work, so that x / m fits in a 32-bit integer.
        unsigned x_high = x >> 32, x_low = (unsigned) x;
        unsigned quot, rem;
        asm("divl %4\n"
            : "=a" (quot), "=d" (rem)
            : "d" (x_high), "a" (x_low), "r" (m));
        return rem;
    }

    mod_int& operator*=(const mod_int &other) {
        val = fast_mod((uint64_t) val * other.val);
        return *this;
    }

    mod_int& operator/=(const mod_int &other) {
        return *this *= other.inv();
    }

    friend mod_int operator+(const mod_int &a, const mod_int &b) { return mod_int(a) += b; }
    friend mod_int operator-(const mod_int &a, const mod_int &b) { return mod_int(a) -= b; }
    friend mod_int operator*(const mod_int &a, const mod_int &b) { return mod_int(a) *= b; }
    friend mod_int operator/(const mod_int &a, const mod_int &b) { return mod_int(a) /= b; }

    mod_int& operator++() {
        val = val == MOD - 1 ? 0 : val + 1;
        return *this;
    }

    mod_int& operator--() {
        val = val == 0 ? MOD - 1 : val - 1;
        return *this;
    }

    mod_int operator++(int) { mod_int before = *this; ++*this; return before; }
    mod_int operator--(int) { mod_int before = *this; --*this; return before; }

    mod_int operator-() const {
        return val == 0 ? 0 : MOD - val;
    }

    bool operator==(const mod_int &other) const { return val == other.val; }
    bool operator!=(const mod_int &other) const { return val != other.val; }

    mod_int inv() const {
        return mod_inv(val);
    }

    mod_int pow(long long p) const {
        assert(p >= 0);
        mod_int a = *this, result = 1;

        while (p > 0) {
            if (p & 1)
                result *= a;

            a *= a;
            p >>= 1;
        }

        return result;
    }

    friend ostream& operator<<(ostream &stream, const mod_int &m) {
        return stream << m.val;
    }
};


int N, X;
vector<int> L;

int main() {
    cin >> N >> X;
    L.resize(N);

    for (int &len : L)
        cin >> len;

    sort(L.rbegin(), L.rend());
    vector<vector<mod_int>> dp(N + 1, vector<mod_int>(X + 1, 0));
    dp[0][0] = 1;

    for (int i = 0; i < N; i++) {
        int len = L[i];
        vector<vector<mod_int>> next_dp(N + 1, vector<mod_int>(X + 1, 0));

        for (int n = 0; n <= i; n++)
            for (int sum = 0; sum <= X; sum++)
                if (dp[n][sum] != 0) {
                    if (sum + len <= X)
                        next_dp[n + 1][sum + len] += dp[n][sum];

                    if (n >= 1) {
                        next_dp[n][sum] += (sum - n * (len - 1)) * dp[n][sum];

                        for (int add = 1; add < len; add++)
                            if (sum + add <= X)
                                next_dp[n][sum + add] += 2 * n * dp[n][sum];
                    }

                    if (n >= 2) {
                        for (int add = 0; add < len - 1; add++)
                            if (sum + add <= X)
                                next_dp[n - 1][sum + add] += n * (n - 1) * (len - 1 - add) * dp[n][sum];
                    }
                }

        swap(dp, next_dp);
    }

    mod_int total = 0, factorial = 1;

    for (int n = 1; n <= N; n++) {
        factorial *= n;
        total += factorial * dp[n][X];
    }

    cout << total << '\n';
}


Measured memory_bytes: 704