// https://atcoder.jp/contests/dwacon6th-prelims/tasks/dwacon6th_prelims_e
//
#![allow(unused_imports)]
use std::io::*;
use std::io::Write;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, [ next / $t:tt ]) => {
        {
            let len = read_value!($iter, usize);
            (0..len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
        }
    };

    ($iter:expr, switch) => {
        {
            let ty = read_value!($iter, i32);
            if ty == 1 {
                vec![ty, read_value!($iter, i32), read_value!($iter, i32)]
            } else if ty == 2 {
                vec![ty, read_value!($iter, i32)]
            } else {
                vec![ty, read_value!($iter, i32)]
            }
        }
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! dvec {
    ($t:expr ; $len:expr) => {
        vec![$t; $len]
    };

    ($t:expr ; $len:expr, $($rest:expr),*) => {
        vec![dvec!($t; $($rest),*); $len]
    };
}

#[allow(unused_macros)]
macro_rules! ifv {
    ($t:expr, $a:expr, $b: expr) => {
        if $t { $a } else { $b }
    }
}

#[allow(unused_macros)]
macro_rules! fill {
    ($t:expr, $v:expr) => {
        for i in 0..$t.len() {
            $t[i] = $v;
        }
    };
}

#[allow(unused_macros)]
macro_rules! join {
    ($t:expr, $glue:expr) => {
        $t.into_iter().map(|w| w.to_string()).collect::<Vec<_>>().join($glue)
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

// ===

const MOD: i64 = 1e9 as i64 + 7;

fn main() {
    input! {
        n: usize, x: usize,
        sheets: [usize; n]
    };

    let mut comb = dvec!(0; x+1, x+1);
    for i in 0..x+1 {
        comb[i][0] = 1;
        comb[i][i] = 1;
        for j in 1..i {
            comb[i][j] = (comb[i-1][j-1] + comb[i-1][j]) % MOD;
        }
    }

    let mut count = vec![0; x+1];
    for i in 0..n {
        count[sheets[i]] += 1;
    }

    let mut dp = dvec!(0; 2, x+1, x+1);
    dp[x%2][0][0] = 1;
    for i in (1..x+1).rev() {
        let f = i % 2;
        let t = 1 - f;
        for c in 0..x+1 {
            for l in 0..x+1 {
                dp[t][c][l] = 0;
            }
        }

        let seg_count = count[i];
        for c in 0..x+1 {
            for l in 0..x+1 {
                let base = dp[f][c][l];
                if base == 0 {
                    continue;
                }
                for w in 0..x+1 {
                    let tc = c + w;
                    let tl = l + w * i;
                    if tl > x {
                        break;
                    }
                    let mut factor = 1;
                    if seg_count >= 1 {
                        let b = ifv!(tc == 0, 0, tl - tc * (i - 1)) as i64;
                        for i in 0..seg_count {
                            factor *= b;
                            factor %= MOD;
                        }
                    }
                    dp[t][tc][tl] += base * comb[tc][w] % MOD * factor % MOD;
                    dp[t][tc][tl] %= MOD;
                }
            }
        }
    }

    let mut ans = 0;
    for c in 1..x+1 {
        for l in 0..x+1 {
            if l + c - 1 > x {
                break;
            }
            let base = dp[0][c][l];
            if base == 0 {
                continue;
            }
            let place_one = x - (l + c - 1);
            let empty = place_one + c - 1;
            let add = base * comb[place_one+c][c] % MOD;
            if empty % 2 == 0 {
                ans += add;
            } else {
                ans += MOD-add;
            }
            ans %= MOD;
        }
    }
    // debug!(dp[0]);
    println!("{}", ans);
}


Measured memory_bytes: 10492