// May this submission get accepted
#include <bits/stdc++.h>

// エイリアス
using  ll = long signed long;
using ull = long unsigned long;
using  ld = long double;
using namespace std;

// エイリアス (補完・コンパイルが重くなる)
// #include <boost/multiprecision/cpp_int.hpp>
// using mll = boost::multiprecision::cpp_int;

// 汎用マクロ
#define ALL_OF(x) (x).begin(), (x).end()
#define REP(i,n) for (long long i=0, i##_len=(n); i<i##_len; i++)
#define RANGE(i,is,ie) for (long long i=(is), i##_end=(ie); i<=i##_end; i++)
#define DSRNG(i,is,ie) for (long long i=(is), i##_end=(ie); i>=i##_end; i--)
#define STEP(i, is, ie, step) for (long long i=(is), i##_end=(ie), i##_step = (step); i<=i##_end; i+=i##_step)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
#define FOREACH(i,q) for (auto &i : q)
template<class T> bool chmax(T &a, const T b) { if (a < b) {a = b; return true;} return false; }
template<class T> bool chmin(T &a, const T b) { if (a > b) {a = b; return true;} return false; }
constexpr int INF = numeric_limits<int>::max();
constexpr long long LINF = numeric_limits<long long>::max();
constexpr long double EPS = 1e-10L;
#define Yes(q) ((q) ? "Yes" : "No")
#define YES(q) ((q) ? "YES" : "NO")
#define Possible(q) ((q) ? "Possible" : "Impossible")
#define POSSIBLE(q) ((q) ? "POSSIBLE" : "IMPOSSIBLE")
#define IIF(q,t,f) ((q) ? (t) : (f))
#define DUMP(q) DUMP_FUNC(q, #q, __FILE__, __LINE__)
template <typename T> void DUMP_PROC(T x) { if (is_integral<T>() || is_floating_point<T>()) cerr << "\e[32m" << x << "\e[m"; else cerr << x; }
template<> void DUMP_PROC<char>(char x) { cerr << "\e[36m\'" << x << "\'\e[m"; }
template<> void DUMP_PROC<string>(string x) { cerr << "\e[33m\"" << x << "\"\e[m"; }
template <typename T, typename U> void DUMP_PROC(pair<T, U> x) { cerr << "{"; DUMP_PROC(x.first); cerr << ", "; DUMP_PROC(x.second); cerr << "}"; }
template <typename ...T, typename U, U... Seq> void DUMP_PROC(tuple<T...> &x, integer_sequence<U, Seq...>) { (void)(int[]){(cerr << ((const char*[]){"", ", "})[!!Seq] << (DUMP_PROC(get<Seq>(x)), ""), 0)...}; }
template <typename ...T> void DUMP_PROC(tuple<T...> x) {cerr << "{"; DUMP_PROC(x, index_sequence_for<T...>()); cerr << "}";}
template <typename T> void DUMP_PROC(vector<T> x) { cerr << "["; for (auto &xi : x) { DUMP_PROC(xi); cerr << (&xi != &*x.rbegin()?", ":""); } cerr << "]"; }
template <typename T> void DUMP_FUNC(T x, const char* name, const char* fn, int ln) { cerr << "\e[32m[DEBUG]\e[m " << name << ": "; DUMP_PROC(x); cerr << " @ " << fn << "(" << ln << ")" << endl; }
template <class T> T gcd(T a, T b) { if (a < b) swap(a, b); while (b) swap(a %= b, b); return a; }
template <class T> T lcm(const T a, const T b) { return a / gcd(a, b) * b; }

// gcc拡張マクロ
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll

// 標準入出力
struct qin { // query input
    size_t sz;
    qin(size_t _sz = 1) : sz(_sz) {}
    template <typename T> operator T () const { T a; cin >> a; return a; }
    template <typename T> operator vector<T> () const { vector<T> a(sz); for (size_t i = 0; i < sz; i++) cin >> a[i]; return a; }
    template <typename T, typename U> operator pair<T, U> () const { T f; U s; cin >> f >> s; return pair<T, U>(f, s); }
};
qin in1; // input one
template <typename T> void say(const T x, const char* end = "\n") { cout << x << end; }
void say(const ld x, const char* end = "\n") { cout << setprecision(30) << x << end; }
template <typename T> void say(const vector<T> x, const char* sep = " ", const char* end = "\n") { REP(i, x.size()) { cout << x[i] << (i+1 == i_len ? end : sep); } }
template <typename T> void say(const vector<vector<T>> x, const char* sep = " ", const char* end = "\n") { REP(i, x.size()) { say(x[i], sep, end); } }

// モジュール

// 遅延評価セグ木 T: 値の型, U: 操作の型
template<typename T, typename U, typename JOIN_T, typename APPLY_U, typename JOIN_U, typename MULTIPLY_U, typename HALF_U>
class segtree {
    T IT; // T の単位元
    U IU; // U の単位元
    JOIN_T join_t; // 値同士のjoin; T(T: 左の値, T: 右の値)
    APPLY_U apply_u; // 操作を値に適用する; T(T: 操作前の値, U: 操作)
    JOIN_U join_u; // 操作をjoinする; U(U: 古い操作, U: 新しい操作)
    MULTIPLY_U multiply_u; // 操作をn回やる操作を作る; U(U: 操作, ll: 2冪の正整数)
    HALF_U half_u; // 半分の操作を作る; U(U: multiply_uによって2冪倍された操作)
    ll n; // 元の配列のサイズ
    vector<T>    node;
    vector<U>    lazy;
    vector<char> fall; // vector<bool>は空間が良いが時間が悪いのでvector<char>で代用
    // [l, r) を見ており, k を遅延評価
    inline void eval(ll k, ll l, ll r) {
        if (!fall[k]) return;
        node[k] = apply_u(node[k], lazy[k]);
        if (r-l > 1) { // 子があるなら伝播
            lazy[k*2+1] = join_u(lazy[k*2+1], half_u(lazy[k]));
            lazy[k*2+2] = join_u(lazy[k*2+2], half_u(lazy[k]));
            fall[k*2+1] = fall[k*2+2] = true;
        }
        lazy[k] = IU;
        fall[k] = false;
    }
public:
    // コンストラクタ
    segtree(const vector<T> &v, T _it, U _iu, JOIN_T _jot, APPLY_U _apu, JOIN_U _jou, MULTIPLY_U _muu, HALF_U _hau):
        IT(_it), IU(_iu), join_t(_jot), apply_u(_apu), join_u(_jou), multiply_u(_muu), half_u(_hau)
    {
        ll sz = (ll)v.size();
        n = 1; while (n < sz) n *= 2;
        this->node = vector<T   >(n * 2 - 1, IT);
        this->lazy = vector<U   >(n * 2 - 1, IU);
        this->fall = vector<char>(n * 2 - 1, false);
        for (ll i = 0; i < sz; i++) node[n-1 + i] = v[i];
        for (ll i = n-1; i--; )  node[i] = join_t(node[i*2+1], node[i*2+2]);
    }
    // 区間 [a, b) に x を適用（但し, [l, r)を見て今kをいじっている）
    void apply(ll a, ll b, U x, ll k = 0, ll l = 0, ll r = -1) {
        if (r < 0) r = n; // デフォルト値には定数しか入れられない
        eval(k, l, r);
        if (b <= l || r <= a) return; // セグフォ防止
        if (a <= l && r <= b) {
            lazy[k] = join_u(lazy[k], multiply_u(x, r - l));
            fall[k] = true;
            eval(k, l, r);
        } else {
            apply(a, b, x, k*2+1, l, (l+r)/2);
            apply(a, b, x, k*2+2, (l+r)/2, r);
            node[k] = join_t(node[k*2+1], node[k*2+2]);
        }
    }
    // 区間 [a, b) の操作後の値を求める
    T fetch(ll a, ll b, ll k = 0, ll l = 0, ll r = -1) {
        if (r < 0) r = n; // デフォルト値には定数しか入れられない
        if (b <= l || r <= a) return IT; // セグフォ防止
        eval(k, l, r);
        if (a <= l && r <= b) return node[k];
        T vl = fetch(a, b, k*2+1, l, (l+r)/2);
        T vr = fetch(a, b, k*2+2, (l+r)/2, r);
        return join_t(vl, vr);
    }
    // 点 a == 区間 [a, a+1) に x を適用
    inline void applyp(ll a, U x) { apply(a, a+1, x); }
    // 点 a == 区間 [a,a+1) の操作後の値を求める
    inline T fetchp(ll a) { return fetch(a, a+1); }
};
// C++17以降の環境ではこの関数は不要 (テンプレート引数推論が働くため)
template<typename T, typename U, typename JOIN_T, typename APPLY_U, typename JOIN_U, typename MULTIPLY_U, typename HALF_U>
segtree<T, U, JOIN_T, APPLY_U, JOIN_U, MULTIPLY_U, HALF_U> make_segtree(const vector<T> &v, T _it, U _iu, JOIN_T _jot, APPLY_U _apu, JOIN_U _jou, MULTIPLY_U _muu, HALF_U _hau) {
    return segtree<T, U, JOIN_T, APPLY_U, JOIN_U, MULTIPLY_U, HALF_U>(v, _it, _iu, _jot, _apu, _jou, _muu, _hau);
}
// おまけ
const auto SEGTREE_ASGF = [](ll, ll y) { return y; };
const auto SEGTREE_EYE2 = [](ll x, ll) { return x; };
const auto SEGTREE_EYE = [](ll x) { return x; };
auto make_segtree_rminq(const vector<ll> &v) {
    auto minf = [](ll x, ll y) { return min(x, y); };
    return make_segtree(v, LINF, LINF, minf, SEGTREE_ASGF, SEGTREE_ASGF, SEGTREE_EYE2, SEGTREE_EYE);
}
auto make_segtree_rmaxq(const vector<ll> &v) {
    auto maxf = [](ll x, ll y) { return max(x, y); };
    return make_segtree(v, LINF, LINF, maxf, SEGTREE_ASGF, SEGTREE_ASGF, SEGTREE_EYE2, SEGTREE_EYE);
}

// 剰余演算ライブラリ (小): 剰余と逆元だけ欲しいときに使う軽量ライブラリ
// mod pdiv 上での a^n
ll modpow(const ll a, ll n, const ll pdiv) {
    if (a == 0) return 0;
    ll r = 1;
    ((n %= pdiv-1) += pdiv-1) %= pdiv-1; // a^(p-1) === a^0 mod pdiv
    for (ll b = (a % pdiv + pdiv) % pdiv; n; n >>= 1, (b *= b) %= pdiv) if (n & 1) (r *= b) %= pdiv;
    return r;
}
inline ll modinv(const ll a, const ll pdiv) { return modpow(a, pdiv-2, pdiv); }

// [Requirement] modint_petit.cpp
// Garnerのアルゴリズム O(|w|^2)
// w[i] = {x[i], m[i]} とすると {x === x[i] mod m[i]} から x mod pdiv を復元
// w[i].second (m[i]) は pairwise 互いに素である必要がある
ll garner (const vector<pair<ll, ll>> &w, const ll pdiv) {
    vector<ll> p(w.size()+1, 1);
    vector<ll> v(w.size()+1, 0);
    for (size_t k = 0; k < w.size(); k++) {
        ll xk, mk; tie(xk, mk) = w[k];
        ll t = ((xk - v[k]) % mk + mk) % mk * modinv(p[k], mk) % mk;
        for (size_t i = k+1; i <= w.size(); i++) {
            ll bi = i == w.size() ? pdiv : w[i].second;
            (v[i] += t * p[i]) %= bi;
            (p[i] *= w[k].second) %= bi;
        }
    }
    return v.back();
};

// [Requirement] modint_petit.cpp
// [Requirement] garner.cpp
// 精度に寄りけりだがconv1回で済むFFTの方がいい場合もあることに留意
// Cooley-Tukey型 高速フーリエ変換 O(NlogN)
template <ll pdiv = 998244353, ll prim = 3>
vector<ll> ntt(vector<ll> a, const bool inv = false) {
    // Shita-goshirae
    ll n = 1, h = 0;
    while (n < a.size()) n <<= 1, h++;
    a.resize(n, 0);
    for (size_t i = 0; i < n; i++) {
        ((a[i] %= pdiv) += pdiv) %= pdiv;
    }
    // Cooley-Tukey sort
    for (size_t i = 0; i < n; i++) {
        size_t j = 0;
        for (size_t k = 0; k < h; k++) {
            j |= (i >> k & 1) << (h-1 - k);
        }
        if (i < j) swap(a[i], a[j]);
    }
    // butterfly enzan
    for (size_t b = 1; b < n; b <<= 1) {
        const ll root = modpow(prim, (pdiv-1) / (b << 1) * (inv ? -1 : 1), pdiv);
        ll w = 1;
        for (size_t j = 0; j < b; j++) {
            for (size_t k = 0; k < n; k += b << 1) {
                ll s = a[j+k  ];
                ll t = a[j+k+b] * w % pdiv;
                a[j+k  ] = (s+t) % pdiv;
                a[j+k+b] = (s-t + pdiv) % pdiv;
            }
            (w *= root) %= pdiv;
        }
    }
    if (inv) {
        const ll invn = modinv(n, pdiv);
        for (ll i = n; i--; ) (a[i] *= invn) %= pdiv;
    }
    return a;
}
// 適切な原始根の存在する法での畳み込み
template <ll pdiv, ll prim>
vector<ll> convolve_p(const vector<ll> &x, const vector<ll> &y) {
    size_t t = x.size() + y.size() - 1;
    auto a = x; a.resize(t, 0);
    auto b = y; b.resize(t, 0);
    auto A = ntt<pdiv, prim>(a);
    auto B = ntt<pdiv, prim>(b);
    for (size_t i = 0; i < A.size(); i++) (A[i] *= B[i]) %= pdiv;
    auto result = ntt<pdiv, prim>(A, true);
    result.resize(t);
    return result;
}
// 任意MODでの畳み込み演算
vector<ll> convolve(const vector<ll> &x, const vector<ll> &y, const ll pdiv) {
    if (pdiv == 998244353) return convolve_p<998244353, 3>(x, y);
    // 1. 配列の大きさが 2^23 ~= 8e6 超えたら1の2^N乗根求まらなくてバグる
    //   競プロならO(N)すらTLEしかねないから大丈夫
    //   conv2をコメントアウトするとこの上限が2^24 ~= 1.6e7ほどに伸びる
    // 2. 答えの大きさが Πm ~= 9.6e34 超えたらGarnerがバグる
    //   すなわち配列x, yの各項が √(Πm/2^23) ~= 1e14 超えてるとバグる
    //   競プロなら大抵法が1e9くらいなので大丈夫
    //   conv2をコメントアウトすると上限が 2.398e9 ほどになるが1e9+7とかならセーフ
    // 3. 出典: https://lumakernel.github.io/ecasdqina/math/FFT/NTT
    //     {1224736769, 3}, // 2^24 * 73 + 1
    //     {998244353, 3},  // 2^23 * 7 * 17 + 1
    //     {469762049, 3},  // 2^26 * 7 + 1
    //     {167772161, 3},  // 2^25 * 5 + 1
    const auto conv1 = convolve_p<1224736769, 3>(x, y);
    // const auto conv2 = convolve_p<998244353, 3>(x, y);
    const auto conv3 = convolve_p<469762049, 3>(x, y);
    const auto conv4 = convolve_p<167772161, 3>(x, y);
    ll n = conv1.size();
    ll t = x.size() + y.size() - 1;
    vector<ll> result(t, 0);
    for (ll i = 0; i < t; i++) {
        vector<pair<ll, ll>> g = {
            {conv1[i], 1224736769},
            // {conv2[i], 998244353},
            {conv3[i], 469762049},
            {conv4[i], 167772161}
        };
        result[i] = garner(g, pdiv);
    }
    return result;
}

// [Requirement] modint_petit.cpp
// [Requirement] ntt.cpp
// 形式的冪級数ライブラリ
struct formal_series {
    vector<ll> coeff;
    ll pdiv = 998244353LL; // 適宜変更のこと、インスタンス生成時以外で変更したときの動作は未定義
    formal_series(const ll x = 0): coeff(1, x) {}
    formal_series(const initializer_list<ll> &x): coeff(x) {}
    formal_series(const vector<ll> &x): coeff(x) {}
    size_t size() const { return coeff.size(); }
    void resize(size_t deg) { coeff.resize(deg, 0); }
    formal_series pow(size_t n, size_t deg) const {
        if (n == 0) return formal_series(1);
        if (n == 1) return formal_series(coeff);
        if (n < 0) return this->pow(-n, deg).inv(deg);
        vector<ll> rs = {1};
        vector<ll> bs = coeff;
        for (size_t mask = n; mask; mask >>= 1) {
            if (mask & 1) {
                rs = convolve(bs, rs, pdiv);
                if (rs.size() > deg) rs.resize(deg);
            }
            bs = convolve(bs, bs, pdiv);
            if (bs.size() > deg) bs.resize(deg);
        }
        rs.resize(deg);
        return formal_series(rs);
    }
    formal_series inv(size_t deg) const {
        assert(coeff.front() != 0);
        vector<ll> rs = {modinv(coeff.front(), pdiv)};
        for (size_t i = 1; i < deg; i *= 2) {
            auto rs2 = rs; for (ll &rsi : rs2) (rsi *= 2) %= pdiv;
            auto rss = convolve(rs, rs, pdiv);
            vector<ll> as(i*2, 0);
            REP(j, min<ll>(i*2, coeff.size())) as[j] = (coeff[j] % pdiv + pdiv) % pdiv;
            auto rcv = convolve(rss, as, pdiv);
            rs .resize(i*2, 0);
            rs2.resize(i*2, 0);
            rcv.resize(i*2, 0);
            for (size_t j = 0; j < i*2; j++) {
                rs[j] = (rs2[j] - rcv[j] + pdiv) % pdiv;
            }
        }
        rs.resize(deg);
        return formal_series(rs);
    }
    formal_series operator* (const formal_series &a) const { assert(pdiv == a.pdiv); auto f = formal_series(convolve(coeff, a.coeff, pdiv)); f.resize(max(this->size(), a.size())); return f; }
    formal_series& operator*= (const formal_series &a) { return *this = *this * a; }
    formal_series& operator+= (const formal_series &a) { assert(pdiv == a.pdiv); this->resize(max(this->size(), a.size())); REP(i, min(this->size(), a.size())) (this->coeff[i] += a.coeff[i]) %= pdiv; return *this; }
    formal_series operator+ (const formal_series &a) const { formal_series rs = *this; rs += a; return rs; }
    formal_series& operator-= (const formal_series &a) { assert(pdiv == a.pdiv); this->resize(max(this->size(), a.size())); REP(i, min(this->size(), a.size())) (this->coeff[i] += pdiv - a.coeff[i]) %= pdiv; return *this; }
    formal_series operator- (const formal_series &a) const { formal_series rs = *this; rs -= a; return rs; }
    formal_series operator/ (const formal_series &a) const { assert(pdiv == a.pdiv); return *this * a.inv(min(this->size(), a.size())); }
    formal_series operator/= (const formal_series &a) { return *this = *this / a; }
};
formal_series operator"" _fs(unsigned long long _x) { return formal_series(_x); }

// WARNING: [a, b)
formal_series fetch(const vector<formal_series> &v, ll l, ll r, ll x, ll y, ll i) {
    if (r <= x || y <= l) return 1_fs;
    if (l <= x && y <= r) return v[i];
    ll z = (x+y) / 2;
    formal_series t1 = fetch(v, l, r, x, z, i*2+1);
    formal_series t2 = fetch(v, l, r, z, y, i*2+2);
    return t1 * t2;
}

// 処理内容
int main() {
    
    ios::sync_with_stdio(false); // stdioを使うときはコメントアウトすること
    cin.tie(nullptr);            // インタラクティブ問題ではコメントアウトすること
    
    ll n = in1;
    ll s = in1;
    vector<ll> a = qin(n);
    
    ll m = 1; while (m < n) m *= 2;
    vector<formal_series> v(m*2, 1_fs);
    REP(i, m*2-1) {
        v[i].resize(s+1);
    }
    REP(i, n) {
        v[m-1 + i].coeff[a[i]] = 1;
    }

    
    DSRNG(i, m-2, 0) {
        ll c1 = i*2+1, c2 = i*2+2;
        // DUMP(i);
        // DUMP(v[c1].coeff);
        // DUMP(v[c2].coeff);
        v[i] = v[c1] * v[c2];
        // DUMP(v[i].coeff);
    }

    // REP(i, m*2-1) {
    //     DUMP(v[i].coeff);
    // }

    ll ans = 0;
    REP(j, n+1) REP(i, j) {
        // cerr << "[DEBUG] " << i << ", " << j << endl;
        formal_series x = fetch(v, i, j, 0, m, 0);
        ll term = x.coeff.at(s);
        // DUMP(x.coeff);
        (ans += term) %= 998244353;
    }
    say(ans);
    exit(0);
    
}