// be name khoda \\

// #define stream_enable
// #define bloat_enable
#define long_enable
#define debug_enable

#ifdef bloat_enable
#include <bits/stdc++.h>
#else
#include <iostream>
#include <map>
#include <iomanip>
#include <vector>
#include <set>
#include <cmath>
#include <utility>
#include <algorithm>
#include <sstream>
#include <queue>
#include <stack>
#include <limits.h>
#include <fstream>
#include <cstring>
#endif

using namespace std;

#ifdef stream_enable
#define cin sss
#endif

#ifdef long_enable
typedef long long int ll;
#else
typedef int ll;
#endif

typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef pair<ll, pii> pip;
typedef vector<vi> vii;
typedef vector<vii> viii;
typedef vector<bool> vb;
typedef vector<vb> vbb;
typedef vector<pii> vpii;
typedef vector<pip> vpip;
typedef priority_queue<ll> maxHeap;
typedef priority_queue<ll, vi, greater<ll>> minHeap;

const ll MOD = 1000000007;

const long long BIG = 1446803456761533460LL;
const int Big = 336860180;

#ifdef long_enable
const ll INF = LONG_LONG_MAX;
#else
const ll INF = INT_MAX;
#endif

const vii adj4({{0, 1}, {0, -1}, {1, 0}, {-1, 0}});
const vii adj8({{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {-1, -1}, {1, -1}, {-1, 1}, {1, 1}});

#define mp make_pair
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define pb push_back

#define print(x) cout << (x) << endl
#define printv(x) fori (j12345, (x).size()) { cout << (x)[j12345] << ' '; } cout << endl
#define printvv(x) fori (i123456, (x).size()) { fori (j123456, (x)[i123456].size()) { cout << (x)[i123456][j123456] << ' '; } cout << endl; }
#define printp(x) cout << "(" << x.ff << ", " << x.ss << ")" << endl
#define printvp(x) fori (i1234567, (x).size()) { cout << "(" << x[i1234567].ff << ", " << x[i1234567].ss << ")" << endl; }
#define printa(x, n) fori (ja12345, n) { cout << (x)[ja12345] << ' '; } cout << endl
#define printap(x, n) fori (ia1234567, n) { cout << "(" << x[ia1234567].ff << ", " << x[ia1234567].ss << ")" << endl; }
#define printaa(x, n, m) fori (iaa123456, n) { fori (jaa123456, m) { cout << (x)[iaa123456][jaa123456] << ' '; } cout << endl; }

#ifdef debug_enable
#define debug(x) cout << #x << " -> "; print(x)
#define debugv(x) cout << #x << " -> "; printv(x)
#define debugvv(x) cout << #x << " ->\n"; printvv(x)
#define debugp(x) cout << #x << " -> "; printp(x)
#define debugvp(x) cout << #x << " ->\n"; printvp(x)
#define debuga(x, n) cout << #x << " -> "; printa(x, n)
#define debugap(x, n) cout << #x << " ->\n"; printap(x, n)
#define debugaa(x, n, m) cout << #x << " ->\n"; printaa(x, n, m)
#else
#define debug(x)
#define debugv(x)
#define debugvv(x)
#define debugp(x)
#define debugvp(x)
#define debuga(x, n)
#define debugap(x, n)
#define debugaa(x, n, m)
#endif

#define fori(i, n) for(ll i = 0; i < (n); ++i)
#define forir(i, n) for(ll i = (n) - 1; i >= 0; --i)
#define forifrom(i, f, n) for(ll i = (f); i < (n); ++i)
#define forirto(i, n, f) for(ll i = (n); i >= (f); --i)

#define smin(a, b) a = min(a, (b))
#define smax(a, b) a = max(a, (b))

#define inp(x) ll x; cin >> x
#define inp2(x, y) ll x, y; cin >> x >> y
#define inp3(x, y, z) ll x, y, z; cin >> x >> y >> z
#define inp4(x, y, z, zz) ll x, y, z, zz; cin >> x >> y >> z >> zz
#define inpvi(x, size) vi x(size); fori(i123458, size) cin >> x[i123458]

ll gcd(ll a, ll b) {
    return b == 0 ? a : gcd(b, a % b);
}

bool isprime(ll n) {
    if (n == 2 || n == 3) return true;
    if (n < 2 || n % 2 == 0 || n % 3 == 0) return false;
    for (ll i = 6; (i - 1) * (i - 1) <= n; i += 6) {
        if (n % (i - 1) == 0 || n % (i + 1) == 0) {
            return false;
        }
    }
    return true;
}

vb sprime;
void genPrime(ll sz) {
    sprime = vb(sz, true);
    sprime[0] = false;
    sprime[1] = false;
    forifrom (i, 2, sz) {
        if (sprime[i]) {
            for (ll j = i * i; j < sz; j += i) {
                sprime[j] = false;
            }
        }
    }
}

ll powMod(ll a, ll b, ll mod) {
    ll n = 1;
    ll p = a;
    while (b > 0) {
        if (b % 2 == 1) {
            n *= p;
            n %= mod;
        }
        p *= p;
        p %= mod;
        b /= 2;
    }
    return n;
}

ll modularInverse(ll a, ll mod) {
    return powMod(a, mod - 2, mod);
}

ll binarysearch(ll l, ll r, bool (*bsfunction) (ll)) {
    while (r - l > 1) {
        ll mid = (l + r) / 2;
        bool val = bsfunction(mid);
        if (val) {
            r = mid;
        } else {
            l = mid;
        }
    }
    return l;
}

stringstream sss;

// -----------------------------------------------------------------------

const ll maxd = 100;
ll mtx[maxd][maxd];
ll res[maxd][maxd];
ll cpy[maxd][maxd];
ll dp[maxd];

void matrix_multiply(ll (&A)[maxd][maxd], ll (&B)[maxd][maxd], ll (&C)[maxd][maxd]) {
    fori (i, maxd) {
        fori (j, maxd) {
            C[i][j] = 0;
            fori (k, maxd) {
                C[i][j] += A[i][k] * B[k][j] % MOD;
                C[i][j] %= MOD;
            }
        }
    }
}

void MAIN() {

    inp2(n, x);
    fori (i, n) {
        inp(a);
        ++mtx[0][a - 1];
    }
    mtx[0][maxd - 1] = 1;
    fori (i, maxd - 2) {
        mtx[i + 1][i] = 1;
    }
    mtx[maxd - 1][maxd - 1] = 1;

    fori (i, maxd - 1) {
        dp[i] = 1;
        forifrom (j, 1, i + 1) {
            dp[i] += dp[i - j] * mtx[0][j - 1];
        }
    }
    if (x < maxd - 1) {
        print(dp[x]);
        return;
    }
    x -= maxd - 2;

    fori (i, maxd) {
        res[i][i] = 1;
    }
    while (x) {
        if (x % 2) {
            fori (i, maxd) {
                fori (j, maxd) {
                    cpy[i][j] = res[i][j];
                }
            }
            matrix_multiply(mtx, cpy, res);
        }
        fori (i, maxd) {
            fori (j, maxd) {
                cpy[i][j] = mtx[i][j];
            }
        }
        matrix_multiply(cpy, cpy, mtx);
        x /= 2;
    }
    ll ans = res[0][maxd - 1];
    fori (i, maxd - 1) {
        ans += res[0][i] * dp[maxd - i - 2] % MOD;
        ans %= MOD;
    }
    print(ans);
}

// -----------------------------------------------------------------------

#ifdef stream_enable
const ll TESTCASEN = 1;
#else
const ll TESTCASEN = 1;
#endif

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
    sss << R"(
3 9
1 2 3
    )";
    fori (i, TESTCASEN) {
        MAIN();
    }
    return 0;
}


// be name khoda \\

// #define stream_enable
// #define bloat_enable
#define long_enable
#define debug_enable

#ifdef bloat_enable
#include <bits/stdc++.h>
#else
#include <iostream>
#include <map>
#include <iomanip>
#include <vector>
#include <set>
#include <cmath>
#include <utility>
#include <algorithm>
#include <sstream>
#include <queue>
#include <stack>
#include <limits.h>
#include <fstream>
#include <cstring>
#endif

using namespace std;

#ifdef stream_enable
#define cin sss
#endif

#ifdef long_enable
typedef long long int ll;
#else
typedef int ll;
#endif

typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef pair<ll, pii> pip;
typedef vector<vi> vii;
typedef vector<vii> viii;
typedef vector<bool> vb;
typedef vector<vb> vbb;
typedef vector<pii> vpii;
typedef vector<pip> vpip;
typedef priority_queue<ll> maxHeap;
typedef priority_queue<ll, vi, greater<ll>> minHeap;

const ll MOD = 1000000007;

const long long BIG = 1446803456761533460LL;
const int Big = 336860180;

#ifdef long_enable
const ll INF = LONG_LONG_MAX;
#else
const ll INF = INT_MAX;
#endif

const vii adj4({{0, 1}, {0, -1}, {1, 0}, {-1, 0}});
const vii adj8({{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {-1, -1}, {1, -1}, {-1, 1}, {1, 1}});

#define mp make_pair
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define pb push_back

#define print(x) cout << (x) << endl
#define printv(x) fori (j12345, (x).size()) { cout << (x)[j12345] << ' '; } cout << endl
#define printvv(x) fori (i123456, (x).size()) { fori (j123456, (x)[i123456].size()) { cout << (x)[i123456][j123456] << ' '; } cout << endl; }
#define printp(x) cout << "(" << x.ff << ", " << x.ss << ")" << endl
#define printvp(x) fori (i1234567, (x).size()) { cout << "(" << x[i1234567].ff << ", " << x[i1234567].ss << ")" << endl; }
#define printa(x, n) fori (ja12345, n) { cout << (x)[ja12345] << ' '; } cout << endl
#define printap(x, n) fori (ia1234567, n) { cout << "(" << x[ia1234567].ff << ", " << x[ia1234567].ss << ")" << endl; }
#define printaa(x, n, m) fori (iaa123456, n) { fori (jaa123456, m) { cout << (x)[iaa123456][jaa123456] << ' '; } cout << endl; }

#ifdef debug_enable
#define debug(x) cout << #x << " -> "; print(x)
#define debugv(x) cout << #x << " -> "; printv(x)
#define debugvv(x) cout << #x << " ->\n"; printvv(x)
#define debugp(x) cout << #x << " -> "; printp(x)
#define debugvp(x) cout << #x << " ->\n"; printvp(x)
#define debuga(x, n) cout << #x << " -> "; printa(x, n)
#define debugap(x, n) cout << #x << " ->\n"; printap(x, n)
#define debugaa(x, n, m) cout << #x << " ->\n"; printaa(x, n, m)
#else
#define debug(x)
#define debugv(x)
#define debugvv(x)
#define debugp(x)
#define debugvp(x)
#define debuga(x, n)
#define debugap(x, n)
#define debugaa(x, n, m)
#endif

#define fori(i, n) for(ll i = 0; i < (n); ++i)
#define forir(i, n) for(ll i = (n) - 1; i >= 0; --i)
#define forifrom(i, f, n) for(ll i = (f); i < (n); ++i)
#define forirto(i, n, f) for(ll i = (n); i >= (f); --i)

#define smin(a, b) a = min(a, (b))
#define smax(a, b) a = max(a, (b))

#define inp(x) ll x; cin >> x
#define inp2(x, y) ll x, y; cin >> x >> y
#define inp3(x, y, z) ll x, y, z; cin >> x >> y >> z
#define inp4(x, y, z, zz) ll x, y, z, zz; cin >> x >> y >> z >> zz
#define inpvi(x, size) vi x(size); fori(i123458, size) cin >> x[i123458]

ll gcd(ll a, ll b) {
    return b == 0 ? a : gcd(b, a % b);
}

bool isprime(ll n) {
    if (n == 2 || n == 3) return true;
    if (n < 2 || n % 2 == 0 || n % 3 == 0) return false;
    for (ll i = 6; (i - 1) * (i - 1) <= n; i += 6) {
        if (n % (i - 1) == 0 || n % (i + 1) == 0) {
            return false;
        }
    }
    return true;
}

vb sprime;
void genPrime(ll sz) {
    sprime = vb(sz, true);
    sprime[0] = false;
    sprime[1] = false;
    forifrom (i, 2, sz) {
        if (sprime[i]) {
            for (ll j = i * i; j < sz; j += i) {
                sprime[j] = false;
            }
        }
    }
}

ll powMod(ll a, ll b, ll mod) {
    ll n = 1;
    ll p = a;
    while (b > 0) {
        if (b % 2 == 1) {
            n *= p;
            n %= mod;
        }
        p *= p;
        p %= mod;
        b /= 2;
    }
    return n;
}

ll modularInverse(ll a, ll mod) {
    return powMod(a, mod - 2, mod);
}

ll binarysearch(ll l, ll r, bool (*bsfunction) (ll)) {
    while (r - l > 1) {
        ll mid = (l + r) / 2;
        bool val = bsfunction(mid);
        if (val) {
            r = mid;
        } else {
            l = mid;
        }
    }
    return l;
}

stringstream sss;

// -----------------------------------------------------------------------

const ll maxd = 4;
ll mtx[maxd][maxd];
ll res[maxd][maxd];
ll cpy[maxd][maxd];
ll dp[maxd];

void matrix_multiply(ll (&A)[maxd][maxd], ll (&B)[maxd][maxd], ll (&C)[maxd][maxd]) {
    fori (i, maxd) {
        fori (j, maxd) {
            C[i][j] = 0;
            fori (k, maxd) {
                C[i][j] += A[i][k] * B[k][j] % MOD;
                C[i][j] %= MOD;
            }
        }
    }
}

void MAIN() {

    inp2(n, x);
    fori (i, n) {
        inp(a);
        ++mtx[0][a - 1];
    }
    mtx[0][maxd - 1] = 1;
    fori (i, maxd - 2) {
        mtx[i + 1][i] = 1;
    }
    mtx[maxd - 1][maxd - 1] = 1;

    fori (i, maxd - 1) {
        dp[i] = 1;
        forifrom (j, 1, i + 1) {
            dp[i] += dp[i - j] * mtx[0][j - 1];
        }
    }
    if (x < maxd - 1) {
        print(dp[x]);
        return;
    }
    x -= maxd - 2;

    fori (i, maxd) {
        res[i][i] = 1;
    }
    while (x) {
        if (x % 2) {
            fori (i, maxd) {
                fori (j, maxd) {
                    cpy[i][j] = res[i][j];
                }
            }
            matrix_multiply(mtx, cpy, res);
        }
        fori (i, maxd) {
            fori (j, maxd) {
                cpy[i][j] = mtx[i][j];
            }
        }
        matrix_multiply(cpy, cpy, mtx);
        x /= 2;
    }
    ll ans = 0;
    fori (i, maxd) {
        ans += res[0][i] * dp[maxd - i - 2] % MOD;
        ans %= MOD;
    }
    print(ans);
}

// -----------------------------------------------------------------------

#ifdef stream_enable
const ll TESTCASEN = 1;
#else
const ll TESTCASEN = 1;
#endif

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
    sss << R"(
3 9
1 2 3
    )";
    fori (i, TESTCASEN) {
        MAIN();
    }
    return 0;
}


// be name khoda \\

// #define stream_enable
// #define bloat_enable
#define long_enable
#define debug_enable

#ifdef bloat_enable
#include <bits/stdc++.h>
#else
#include <iostream>
#include <map>
#include <iomanip>
#include <vector>
#include <set>
#include <cmath>
#include <utility>
#include <algorithm>
#include <sstream>
#include <queue>
#include <stack>
#include <limits.h>
#include <fstream>
#include <cstring>
#endif

using namespace std;

#ifdef stream_enable
#define cin sss
#endif

#ifdef long_enable
typedef long long int ll;
#else
typedef int ll;
#endif

typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef pair<ll, pii> pip;
typedef vector<vi> vii;
typedef vector<vii> viii;
typedef vector<bool> vb;
typedef vector<vb> vbb;
typedef vector<pii> vpii;
typedef vector<pip> vpip;
typedef priority_queue<ll> maxHeap;
typedef priority_queue<ll, vi, greater<ll>> minHeap;

const ll MOD = 1000000007;

const long long BIG = 1446803456761533460LL;
const int Big = 336860180;

#ifdef long_enable
const ll INF = LONG_LONG_MAX;
#else
const ll INF = INT_MAX;
#endif

const vii adj4({{0, 1}, {0, -1}, {1, 0}, {-1, 0}});
const vii adj8({{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {-1, -1}, {1, -1}, {-1, 1}, {1, 1}});

#define mp make_pair
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define pb push_back

#define print(x) cout << (x) << endl
#define printv(x) fori (j12345, (x).size()) { cout << (x)[j12345] << ' '; } cout << endl
#define printvv(x) fori (i123456, (x).size()) { fori (j123456, (x)[i123456].size()) { cout << (x)[i123456][j123456] << ' '; } cout << endl; }
#define printp(x) cout << "(" << x.ff << ", " << x.ss << ")" << endl
#define printvp(x) fori (i1234567, (x).size()) { cout << "(" << x[i1234567].ff << ", " << x[i1234567].ss << ")" << endl; }
#define printa(x, n) fori (ja12345, n) { cout << (x)[ja12345] << ' '; } cout << endl
#define printap(x, n) fori (ia1234567, n) { cout << "(" << x[ia1234567].ff << ", " << x[ia1234567].ss << ")" << endl; }
#define printaa(x, n, m) fori (iaa123456, n) { fori (jaa123456, m) { cout << (x)[iaa123456][jaa123456] << ' '; } cout << endl; }

#ifdef debug_enable
#define debug(x) cout << #x << " -> "; print(x)
#define debugv(x) cout << #x << " -> "; printv(x)
#define debugvv(x) cout << #x << " ->\n"; printvv(x)
#define debugp(x) cout << #x << " -> "; printp(x)
#define debugvp(x) cout << #x << " ->\n"; printvp(x)
#define debuga(x, n) cout << #x << " -> "; printa(x, n)
#define debugap(x, n) cout << #x << " ->\n"; printap(x, n)
#define debugaa(x, n, m) cout << #x << " ->\n"; printaa(x, n, m)
#else
#define debug(x)
#define debugv(x)
#define debugvv(x)
#define debugp(x)
#define debugvp(x)
#define debuga(x, n)
#define debugap(x, n)
#define debugaa(x, n, m)
#endif

#define fori(i, n) for(ll i = 0; i < (n); ++i)
#define forir(i, n) for(ll i = (n) - 1; i >= 0; --i)
#define forifrom(i, f, n) for(ll i = (f); i < (n); ++i)
#define forirto(i, n, f) for(ll i = (n); i >= (f); --i)

#define smin(a, b) a = min(a, (b))
#define smax(a, b) a = max(a, (b))

#define inp(x) ll x; cin >> x
#define inp2(x, y) ll x, y; cin >> x >> y
#define inp3(x, y, z) ll x, y, z; cin >> x >> y >> z
#define inp4(x, y, z, zz) ll x, y, z, zz; cin >> x >> y >> z >> zz
#define inpvi(x, size) vi x(size); fori(i123458, size) cin >> x[i123458]

ll gcd(ll a, ll b) {
    return b == 0 ? a : gcd(b, a % b);
}

bool isprime(ll n) {
    if (n == 2 || n == 3) return true;
    if (n < 2 || n % 2 == 0 || n % 3 == 0) return false;
    for (ll i = 6; (i - 1) * (i - 1) <= n; i += 6) {
        if (n % (i - 1) == 0 || n % (i + 1) == 0) {
            return false;
        }
    }
    return true;
}

vb sprime;
void genPrime(ll sz) {
    sprime = vb(sz, true);
    sprime[0] = false;
    sprime[1] = false;
    forifrom (i, 2, sz) {
        if (sprime[i]) {
            for (ll j = i * i; j < sz; j += i) {
                sprime[j] = false;
            }
        }
    }
}

ll powMod(ll a, ll b, ll mod) {
    ll n = 1;
    ll p = a;
    while (b > 0) {
        if (b % 2 == 1) {
            n *= p;
            n %= mod;
        }
        p *= p;
        p %= mod;
        b /= 2;
    }
    return n;
}

ll modularInverse(ll a, ll mod) {
    return powMod(a, mod - 2, mod);
}

ll binarysearch(ll l, ll r, bool (*bsfunction) (ll)) {
    while (r - l > 1) {
        ll mid = (l + r) / 2;
        bool val = bsfunction(mid);
        if (val) {
            r = mid;
        } else {
            l = mid;
        }
    }
    return l;
}

stringstream sss;

// -----------------------------------------------------------------------

const ll maxd = 110;
ll mtx[maxd][maxd];
ll res[maxd][maxd];
ll cpy[maxd][maxd];
ll dp[maxd];

void matrix_multiply(ll (&A)[maxd][maxd], ll (&B)[maxd][maxd], ll (&C)[maxd][maxd]) {
    fori (i, maxd) {
        fori (j, maxd) {
            C[i][j] = 0;
            fori (k, maxd) {
                C[i][j] += A[i][k] * B[k][j] % MOD;
                C[i][j] %= MOD;
            }
        }
    }
}

void MAIN() {

    inp2(n, x);
    fori (i, n) {
        inp(a);
        ++mtx[0][a - 1];
    }
    mtx[0][maxd - 1] = 1;
    fori (i, maxd - 2) {
        mtx[i + 1][i] = 1;
    }
    mtx[maxd - 1][maxd - 1] = 1;

    fori (i, maxd - 1) {
        dp[i] = 1;
        forifrom (j, 1, i + 1) {
            dp[i] += dp[i - j] * mtx[0][j - 1];
            dp[i] %= MOD;
        }
    }
    if (x < maxd - 1) {
        print(dp[x]);
        return;
    }
    x -= maxd - 2;

    fori (i, maxd) {
        res[i][i] = 1;
    }
    while (x) {
        if (x % 2) {
            fori (i, maxd) {
                fori (j, maxd) {
                    cpy[i][j] = res[i][j];
                }
            }
            matrix_multiply(mtx, cpy, res);
        }
        fori (i, maxd) {
            fori (j, maxd) {
                cpy[i][j] = mtx[i][j];
            }
        }
        matrix_multiply(cpy, cpy, mtx);
        x /= 2;
    }
    ll ans = res[0][maxd - 1];
    fori (i, maxd - 1) {
        ans += res[0][i] * dp[maxd - i - 2] % MOD;
        ans %= MOD;
    }
    print(ans);
}

// -----------------------------------------------------------------------

#ifdef stream_enable
const ll TESTCASEN = 1;
#else
const ll TESTCASEN = 1;
#endif

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
    sss << R"(
3 9
1 2 3
    )";
    fori (i, TESTCASEN) {
        MAIN();
    }
    return 0;
}


// be name khoda \\

// #define stream_enable
// #define bloat_enable
#define long_enable
#define debug_enable

#ifdef bloat_enable
#include <bits/stdc++.h>
#else
#include <iostream>
#include <map>
#include <iomanip>
#include <vector>
#include <set>
#include <cmath>
#include <utility>
#include <algorithm>
#include <sstream>
#include <queue>
#include <stack>
#include <limits.h>
#include <fstream>
#include <cstring>
#endif

using namespace std;

#ifdef stream_enable
#define cin sss
#endif

#ifdef long_enable
typedef long long int ll;
#else
typedef int ll;
#endif

typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef pair<ll, pii> pip;
typedef vector<vi> vii;
typedef vector<vii> viii;
typedef vector<bool> vb;
typedef vector<vb> vbb;
typedef vector<pii> vpii;
typedef vector<pip> vpip;
typedef priority_queue<ll> maxHeap;
typedef priority_queue<ll, vi, greater<ll>> minHeap;

const ll MOD = 1000000007;

const long long BIG = 1446803456761533460LL;
const int Big = 336860180;

#ifdef long_enable
const ll INF = LONG_LONG_MAX;
#else
const ll INF = INT_MAX;
#endif

const vii adj4({{0, 1}, {0, -1}, {1, 0}, {-1, 0}});
const vii adj8({{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {-1, -1}, {1, -1}, {-1, 1}, {1, 1}});

#define mp make_pair
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define pb push_back

#define print(x) cout << (x) << endl
#define printv(x) fori (j12345, (x).size()) { cout << (x)[j12345] << ' '; } cout << endl
#define printvv(x) fori (i123456, (x).size()) { fori (j123456, (x)[i123456].size()) { cout << (x)[i123456][j123456] << ' '; } cout << endl; }
#define printp(x) cout << "(" << x.ff << ", " << x.ss << ")" << endl
#define printvp(x) fori (i1234567, (x).size()) { cout << "(" << x[i1234567].ff << ", " << x[i1234567].ss << ")" << endl; }
#define printa(x, n) fori (ja12345, n) { cout << (x)[ja12345] << ' '; } cout << endl
#define printap(x, n) fori (ia1234567, n) { cout << "(" << x[ia1234567].ff << ", " << x[ia1234567].ss << ")" << endl; }
#define printaa(x, n, m) fori (iaa123456, n) { fori (jaa123456, m) { cout << (x)[iaa123456][jaa123456] << ' '; } cout << endl; }

#ifdef debug_enable
#define debug(x) cout << #x << " -> "; print(x)
#define debugv(x) cout << #x << " -> "; printv(x)
#define debugvv(x) cout << #x << " ->\n"; printvv(x)
#define debugp(x) cout << #x << " -> "; printp(x)
#define debugvp(x) cout << #x << " ->\n"; printvp(x)
#define debuga(x, n) cout << #x << " -> "; printa(x, n)
#define debugap(x, n) cout << #x << " ->\n"; printap(x, n)
#define debugaa(x, n, m) cout << #x << " ->\n"; printaa(x, n, m)
#else
#define debug(x)
#define debugv(x)
#define debugvv(x)
#define debugp(x)
#define debugvp(x)
#define debuga(x, n)
#define debugap(x, n)
#define debugaa(x, n, m)
#endif

#define fori(i, n) for(ll i = 0; i < (n); ++i)
#define forir(i, n) for(ll i = (n) - 1; i >= 0; --i)
#define forifrom(i, f, n) for(ll i = (f); i < (n); ++i)
#define forirto(i, n, f) for(ll i = (n); i >= (f); --i)

#define smin(a, b) a = min(a, (b))
#define smax(a, b) a = max(a, (b))

#define inp(x) ll x; cin >> x
#define inp2(x, y) ll x, y; cin >> x >> y
#define inp3(x, y, z) ll x, y, z; cin >> x >> y >> z
#define inp4(x, y, z, zz) ll x, y, z, zz; cin >> x >> y >> z >> zz
#define inpvi(x, size) vi x(size); fori(i123458, size) cin >> x[i123458]

ll gcd(ll a, ll b) {
    return b == 0 ? a : gcd(b, a % b);
}

bool isprime(ll n) {
    if (n == 2 || n == 3) return true;
    if (n < 2 || n % 2 == 0 || n % 3 == 0) return false;
    for (ll i = 6; (i - 1) * (i - 1) <= n; i += 6) {
        if (n % (i - 1) == 0 || n % (i + 1) == 0) {
            return false;
        }
    }
    return true;
}

vb sprime;
void genPrime(ll sz) {
    sprime = vb(sz, true);
    sprime[0] = false;
    sprime[1] = false;
    forifrom (i, 2, sz) {
        if (sprime[i]) {
            for (ll j = i * i; j < sz; j += i) {
                sprime[j] = false;
            }
        }
    }
}

ll powMod(ll a, ll b, ll mod) {
    ll n = 1;
    ll p = a;
    while (b > 0) {
        if (b % 2 == 1) {
            n *= p;
            n %= mod;
        }
        p *= p;
        p %= mod;
        b /= 2;
    }
    return n;
}

ll modularInverse(ll a, ll mod) {
    return powMod(a, mod - 2, mod);
}

ll binarysearch(ll l, ll r, bool (*bsfunction) (ll)) {
    while (r - l > 1) {
        ll mid = (l + r) / 2;
        bool val = bsfunction(mid);
        if (val) {
            r = mid;
        } else {
            l = mid;
        }
    }
    return l;
}

stringstream sss;

// -----------------------------------------------------------------------

const ll maxd = 100;
ll mtx[maxd][maxd];
ll res[maxd][maxd];
ll cpy[maxd][maxd];
ll dp[maxd];

void matrix_multiply(ll (&A)[maxd][maxd], ll (&B)[maxd][maxd], ll (&C)[maxd][maxd]) {
    fori (i, maxd) {
        fori (j, maxd) {
            C[i][j] = 0;
            fori (k, maxd) {
                C[i][j] += A[i][k] * B[k][j] % MOD;
                C[i][j] %= MOD;
            }
        }
    }
}

void MAIN() {

    inp2(n, x);
    fori (i, n) {
        inp(a);
        ++mtx[0][a - 1];
    }
    mtx[0][maxd - 1] = 1;
    fori (i, maxd - 2) {
        mtx[i + 1][i] = 1;
    }
    mtx[maxd - 1][maxd - 1] = 1;

    fori (i, maxd - 1) {
        dp[i] = 1;
        forifrom (j, 1, i + 1) {
            dp[i] += dp[i - j] * mtx[0][j - 1];
            dp[i] %= MOD;
        }
    }
    if (x < maxd - 1) {
        print(dp[x]);
        return;
    }
    x -= maxd - 2;

    fori (i, maxd) {
        res[i][i] = 1;
    }
    while (x) {
        if (x % 2) {
            fori (i, maxd) {
                fori (j, maxd) {
                    cpy[i][j] = res[i][j];
                }
            }
            matrix_multiply(mtx, cpy, res);
        }
        fori (i, maxd) {
            fori (j, maxd) {
                cpy[i][j] = mtx[i][j];
            }
        }
        matrix_multiply(cpy, cpy, mtx);
        x /= 2;
    }
    ll ans = res[0][maxd - 1];
    fori (i, maxd - 1) {
        ans += res[0][i] * dp[maxd - i - 2] % MOD;
        ans %= MOD;
    }
    print(ans);
}

// -----------------------------------------------------------------------

#ifdef stream_enable
const ll TESTCASEN = 1;
#else
const ll TESTCASEN = 1;
#endif

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
    sss << R"(
3 9
1 2 3
    )";
    fori (i, TESTCASEN) {
        MAIN();
    }
    return 0;
}


// be name khoda \\

// #define stream_enable
// #define bloat_enable
#define long_enable
#define debug_enable

#ifdef bloat_enable
#include <bits/stdc++.h>
#else
#include <iostream>
#include <map>
#include <iomanip>
#include <vector>
#include <set>
#include <cmath>
#include <utility>
#include <algorithm>
#include <sstream>
#include <queue>
#include <stack>
#include <limits.h>
#include <fstream>
#include <cstring>
#endif

using namespace std;

#ifdef stream_enable
#define cin sss
#endif

#ifdef long_enable
typedef long long int ll;
#else
typedef int ll;
#endif

typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef pair<ll, pii> pip;
typedef vector<vi> vii;
typedef vector<vii> viii;
typedef vector<bool> vb;
typedef vector<vb> vbb;
typedef vector<pii> vpii;
typedef vector<pip> vpip;
typedef priority_queue<ll> maxHeap;
typedef priority_queue<ll, vi, greater<ll>> minHeap;

const ll MOD = 1000000007;

const long long BIG = 1446803456761533460LL;
const int Big = 336860180;

#ifdef long_enable
const ll INF = LONG_LONG_MAX;
#else
const ll INF = INT_MAX;
#endif

const vii adj4({{0, 1}, {0, -1}, {1, 0}, {-1, 0}});
const vii adj8({{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {-1, -1}, {1, -1}, {-1, 1}, {1, 1}});

#define mp make_pair
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define pb push_back

#define print(x) cout << (x) << endl
#define printv(x) fori (j12345, (x).size()) { cout << (x)[j12345] << ' '; } cout << endl
#define printvv(x) fori (i123456, (x).size()) { fori (j123456, (x)[i123456].size()) { cout << (x)[i123456][j123456] << ' '; } cout << endl; }
#define printp(x) cout << "(" << x.ff << ", " << x.ss << ")" << endl
#define printvp(x) fori (i1234567, (x).size()) { cout << "(" << x[i1234567].ff << ", " << x[i1234567].ss << ")" << endl; }
#define printa(x, n) fori (ja12345, n) { cout << (x)[ja12345] << ' '; } cout << endl
#define printap(x, n) fori (ia1234567, n) { cout << "(" << x[ia1234567].ff << ", " << x[ia1234567].ss << ")" << endl; }
#define printaa(x, n, m) fori (iaa123456, n) { fori (jaa123456, m) { cout << (x)[iaa123456][jaa123456] << ' '; } cout << endl; }

#ifdef debug_enable
#define debug(x) cout << #x << " -> "; print(x)
#define debugv(x) cout << #x << " -> "; printv(x)
#define debugvv(x) cout << #x << " ->\n"; printvv(x)
#define debugp(x) cout << #x << " -> "; printp(x)
#define debugvp(x) cout << #x << " ->\n"; printvp(x)
#define debuga(x, n) cout << #x << " -> "; printa(x, n)
#define debugap(x, n) cout << #x << " ->\n"; printap(x, n)
#define debugaa(x, n, m) cout << #x << " ->\n"; printaa(x, n, m)
#else
#define debug(x)
#define debugv(x)
#define debugvv(x)
#define debugp(x)
#define debugvp(x)
#define debuga(x, n)
#define debugap(x, n)
#define debugaa(x, n, m)
#endif

#define fori(i, n) for(ll i = 0; i < (n); ++i)
#define forir(i, n) for(ll i = (n) - 1; i >= 0; --i)
#define forifrom(i, f, n) for(ll i = (f); i < (n); ++i)
#define forirto(i, n, f) for(ll i = (n); i >= (f); --i)

#define smin(a, b) a = min(a, (b))
#define smax(a, b) a = max(a, (b))

#define inp(x) ll x; cin >> x
#define inp2(x, y) ll x, y; cin >> x >> y
#define inp3(x, y, z) ll x, y, z; cin >> x >> y >> z
#define inp4(x, y, z, zz) ll x, y, z, zz; cin >> x >> y >> z >> zz
#define inpvi(x, size) vi x(size); fori(i123458, size) cin >> x[i123458]

ll gcd(ll a, ll b) {
    return b == 0 ? a : gcd(b, a % b);
}

bool isprime(ll n) {
    if (n == 2 || n == 3) return true;
    if (n < 2 || n % 2 == 0 || n % 3 == 0) return false;
    for (ll i = 6; (i - 1) * (i - 1) <= n; i += 6) {
        if (n % (i - 1) == 0 || n % (i + 1) == 0) {
            return false;
        }
    }
    return true;
}

vb sprime;
void genPrime(ll sz) {
    sprime = vb(sz, true);
    sprime[0] = false;
    sprime[1] = false;
    forifrom (i, 2, sz) {
        if (sprime[i]) {
            for (ll j = i * i; j < sz; j += i) {
                sprime[j] = false;
            }
        }
    }
}

ll powMod(ll a, ll b, ll mod) {
    ll n = 1;
    ll p = a;
    while (b > 0) {
        if (b % 2 == 1) {
            n *= p;
            n %= mod;
        }
        p *= p;
        p %= mod;
        b /= 2;
    }
    return n;
}

ll modularInverse(ll a, ll mod) {
    return powMod(a, mod - 2, mod);
}

ll binarysearch(ll l, ll r, bool (*bsfunction) (ll)) {
    while (r - l > 1) {
        ll mid = (l + r) / 2;
        bool val = bsfunction(mid);
        if (val) {
            r = mid;
        } else {
            l = mid;
        }
    }
    return l;
}

stringstream sss;

// -----------------------------------------------------------------------

const ll maxd = 4;
ll mtx[maxd][maxd];
ll res[maxd][maxd];
ll cpy[maxd][maxd];
ll dp[maxd];

void matrix_multiply(ll (&A)[maxd][maxd], ll (&B)[maxd][maxd], ll (&C)[maxd][maxd]) {
    fori (i, maxd) {
        fori (j, maxd) {
            C[i][j] = 0;
            fori (k, maxd) {
                C[i][j] += A[i][k] * B[k][j] % MOD;
                C[i][j] %= MOD;
            }
        }
    }
}

void MAIN() {

    inp2(n, x);
    fori (i, n) {
        inp(a);
        ++mtx[0][a - 1];
    }
    mtx[0][maxd - 1] = 1;
    fori (i, maxd - 2) {
        mtx[i + 1][i] = 1;
    }
    mtx[maxd - 1][maxd - 1] = 1;

    fori (i, maxd - 1) {
        dp[i] = 1;
        forifrom (j, 1, i + 1) {
            dp[i] += dp[i - j] * mtx[0][j - 1];
        }
    }
    if (x < maxd - 1) {
        print(dp[x]);
        return;
    }
    x -= maxd - 2;

    fori (i, maxd) {
        res[i][i] = 1;
    }
    while (x) {
        if (x % 2) {
            fori (i, maxd) {
                fori (j, maxd) {
                    cpy[i][j] = res[i][j];
                }
            }
            matrix_multiply(mtx, cpy, res);
        }
        fori (i, maxd) {
            fori (j, maxd) {
                cpy[i][j] = mtx[i][j];
            }
        }
        matrix_multiply(cpy, cpy, mtx);
        x /= 2;
    }
    ll ans = res[0][maxd - 1];
    fori (i, maxd - 1) {
        ans += res[0][i] * dp[maxd - i - 2] % MOD;
        ans %= MOD;
    }
    print(ans);
}

// -----------------------------------------------------------------------

#ifdef stream_enable
const ll TESTCASEN = 1;
#else
const ll TESTCASEN = 1;
#endif

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
    sss << R"(
3 9
1 2 3
    )";
    fori (i, TESTCASEN) {
        MAIN();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

//#define int long long

#pragma GCC optimize("O3")
#pragma GCC target("avx,avx2")
#pragma GCC optimize("unroll-loops")

#define fs first
#define sc second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) (int)x.size()
#define pb push_back
#define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define MP make_pair
#define sqr(x) ((x) * (x))
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 100;
const int MOD = 1e9 + 7;
int cnt[N + 1];

typedef vector<vector<int>> mtx;

void add(int &a, int b) {
	a += b;
	if (a >= MOD)
		a -= MOD;
}

int mul(int a, int b) {
	return 1ll * a * b % MOD;
}

mtx operator *(mtx a, mtx b) {
	mtx ret;
	int n = sz(a);
	ret.resize(n);
	for (int i = 0; i < n; i++) {
		ret[i].resize(n);
		for (int j = 0; j < n; j++) {
			for (int k = 0; k < n; k++) {
				add(ret[i][j], mul(a[i][k], b[k][j]));
			}
		}
	}
	return ret;
}

vector<int> operator *(vector<int> a, mtx b) {
	int n = sz(a);
	vector<int> ret(n);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			add(ret[i], mul(a[j], b[j][i]));
		}
	}
	return ret;
}

mtx ident(int n) {
	mtx ret(n, vector<int>(n));
	for (int i = 0; i < n; i++)
		ret[i][i] = 1;
	return ret;
}

mtx binpow(mtx x, int st) {
	mtx ret = ident(sz(x));
	while (st) {
		if (st & 1) ret = ret * x;
		x = x * x;
		st /= 2;
	}
	return ret;
}

signed main() {
	fastio;
	#ifdef FlameDragon
		freopen("in.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	#endif

	int n, x;
	cin >> n >> x;
	vector<int> dp(N + 1);
	for (int i = 0; i < n; i++) {
		int d;
		cin >> d;
		cnt[d]++;
	}
	dp[0] = 1;

	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= i; j++) {
			add(dp[i], mul(cnt[j], dp[i - j]));
		}
	}
	if (x <= N) {
		cout << accumulate(dp.begin(), dp.begin() + x + 1, 0ll) % MOD << '\n';
		return 0;
	}
	int s = accumulate(all(dp), 0ll) % MOD;
	dp.erase(dp.begin());

	dp.push_back(s);

	mtx a(N + 1, vector<int>(N + 1));
	for (int i = 0; i < N - 1; i++) {
		a[i + 1][i] = 1;
	}
	for (int i = 0; i < N; i++) {
		a[i][N] = a[i][N - 1] = cnt[N - i];
	}

	a[N][N] = 1;
	assert(cnt[0] == 0);
	a = binpow(a, x - N);
	dp = dp * a;

	cout << dp.back() << '\n';
	/*
	for (int i = 1; i <= x; i++) {
		cout << i << ' ' << accumulate(dp.begin(), dp.begin() + i + 1, 0ll) << endl;
	}*/

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define fi first
#define se second
#define ll long long
#define ld long double
#define all(x)              (x).begin(), (x).end()
#define inf                 1e18

using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;

const int S = 101;
const ll mod = 1e9 + 7;

struct matrix {
	vector < vector <ll> > ar;
	matrix() { ar.resize(S, vector <ll> (S, 0)); }
	void make_one() {
		for (int i = 0; i < S; ++i) {
			ar[i][i] = 1;
		}
	}
};

matrix operator * (const matrix &a, const matrix &b) {
	matrix res;
	for (int i = 0; i < S; ++i) {
		for (int j = 0; j < S; ++j) {
			for (int k = 0; k < S; ++k) {
				ll cur = (a.ar[i][k] * b.ar[k][j]) % mod;

				res.ar[i][j] += cur;
				if (res.ar[i][j] >= mod) res.ar[i][j] -= mod;
			}
		}
	}
	return res;
}

matrix bp(matrix a, ll n) {
	matrix res; res.make_one();
	while (n > 0) {
		if (n & 1) res = res * a;
		a = a * a;
		n >>= 1;
	}
	return res;
}

void solve() {
	ll n, x;
	cin >> n >> x;

	vector <ll> cnt(S);

	for (int i = 0; i < n; ++i) {
		int x;
		cin >> x; ++cnt[x];
	}

	vector <ll> dp(S); dp[0] = 1;

	ll sum = 1;
	for (int i = 1; i < S; ++i) {
		for (int j = 1; j < S; ++j) {

			if (i - j < 0) break;
			dp[i] += ( cnt[j] * dp[i - j] ) % mod;
			if (dp[i] >= mod) dp[i] -= mod;
		}
		( sum += dp[i] ) %= mod;
	}

	matrix mt;
	for (int i = 0; i < S - 2; ++i) mt.ar[i + 1][i] = 1;
	for (int i = 0; i < S - 1; ++i) {
		mt.ar[i][S - 2] = mt.ar[i][S - 1] = cnt[100 - i];
	}
	mt.ar[S - 1][S - 1] = 1;

	mt = bp(mt, x - 100);

	ll ans = 0;
	for (int i = 1; i < S; ++i) {
		ll cur = (dp[i] * mt.ar[i - 1][S - 1]) % mod;

		ans += cur;
		if (ans >= mod) ans -= mod;
	}
	ans += (sum * mt.ar[S - 1][S - 1]) % mod;

	if (x < 100) {
		ll r = 0;
		for (int i = 0; i <= x; ++i) {
			r += dp[i];
		}
		cout << r << '\n';
		return;
	}
	cout << ans % mod << '\n';
}

int main() {
        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
//      freopen("input.txt", "r", stdin);
//      freopen("output.txt", "w", stdout);
        int q = 1; // cin >> q;
        while (q--) {
                solve();
        }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define fi first
#define se second
#define ll long long
#define ld long double
#define all(x)              (x).begin(), (x).end()
#define inf                 1e18

using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;

const int S = 101;
const ll mod = 1e9 + 7;

struct matrix {
	vector < vector <ll> > ar;
	matrix() { ar.resize(S, vector <ll> (S, 0)); }
	void make_one() {
		for (int i = 0; i < S; ++i) {
			ar[i][i] = 1;
		}
	}
};

matrix operator * (const matrix &a, const matrix &b) {
	matrix res;
	for (int i = 0; i < S; ++i) {
		for (int j = 0; j < S; ++j) {
			for (int k = 0; k < S; ++k) {
				ll cur = (a.ar[i][k] * b.ar[k][j]) % mod;

				res.ar[i][j] += cur;
				if (res.ar[i][j] >= mod) res.ar[i][j] -= mod;
			}
		}
	}
	return res;
}

matrix bp(matrix a, ll n) {
	matrix res; res.make_one();
	while (n > 0) {
		if (n & 1) res = res * a;
		a = a * a;
		n >>= 1;
	}
	return res;
}

void solve() {
	ll n, x;
	cin >> n >> x;

	vector <ll> cnt(S);

	for (int i = 0; i < n; ++i) {
		int x;
		cin >> x; ++cnt[x];
	}

	vector <ll> dp(S); dp[0] = 1;

	ll sum = 1;
	for (int i = 1; i < S; ++i) {
		for (int j = 1; j < S; ++j) {

			if (i - j < 0) break;
			dp[i] += ( cnt[j] * dp[i - j] ) % mod;
			if (dp[i] >= mod) dp[i] -= mod;
		}
		( sum += dp[i] ) %= mod;
	}

	matrix mt;
	for (int i = 0; i < S - 2; ++i) mt.ar[i + 1][i] = 1;
	for (int i = 0; i < S - 1; ++i) {
		mt.ar[i][S - 2] = mt.ar[i][S - 1] = cnt[100 - i];
	}
	mt.ar[S - 1][S - 1] = 1;

	mt = bp(mt, x - 100);

	ll ans = 0;
	for (int i = 1; i < S; ++i) {
		ll cur = (dp[i] * mt.ar[i - 1][S - 1]) % mod;

		ans += cur;
		if (ans >= mod) ans -= mod;
	}
	ans += (sum * mt.ar[S - 1][S - 1]) % mod;

	if (x < 100) {
		ll r = 0;
		for (int i = 0; i <= x; ++i) {
			r += dp[i];
			if (r >= mod) r -= mod;
		}
		cout << r << '\n';
		return;
	}
	cout << ans % mod << '\n';
}

int main() {
        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
//      freopen("input.txt", "r", stdin);
//      freopen("output.txt", "w", stdout);
        int q = 1; // cin >> q;
        while (q--) {
                solve();
        }
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
struct matrix{
    int n, m, a[105][105];
    void clear() {
        n = m = 0;
        memset(a, 0, sizeof(a));
    }
    matrix(int nn = 0, int mm = 0) { clear(); n = nn, m = mm; }
    friend matrix operator * (matrix x, matrix y) {
        matrix res(x.n, y.m);
        for (int i = 1; i <= x.n; ++i)
            for (int j = 1; j <= y.m; ++j)
                for (int k = 1; k <= x.m; ++k)
                    res.a[i][j] = (res.a[i][j] + 1ll * x.a[i][k] * y.a[k][j]) % MOD;
        return res;
    }
    void operator *= (matrix x) { *this = *this * x; }
};
int n, x, t[103];
matrix ans(1, 101), base(101, 101);
int main() {
    scanf("%d%d", &n, &x);
    for (int i = 1, a; i <= n; ++i) scanf("%d", &a), ++t[a];
    base.a[1][1] = 1;
    for (int i = 1; i <= 100; ++i)
        base.a[i + 1][1] = base.a[i + 1][2] = t[i];
    for (int i = 3; i <= 101; ++i) base.a[i - 1][i] = 1;
    ans.a[1][2] = ans.a[1][1] = 1;
    for (; x; x >>= 1, base *= base)
        if (x & 1) ans *= base;
    printf("%d\n", ans.a[1][1]);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
struct matrix{
    int n, m, a[105][105];
    void clear() {
        n = m = 0;
        memset(a, 0, sizeof(a));
    }
    matrix(int nn = 0, int mm = 0) { clear(); n = nn, m = mm; }
    friend matrix operator * (matrix x, matrix y) {
        matrix res(x.n, y.m);
        for (int i = 1; i <= x.n; ++i)
            for (int j = 1; j <= y.m; ++j)
                for (int k = 1; k <= x.m; ++k)
                    res.a[i][j] = (res.a[i][j] + 1ll * x.a[i][k] * y.a[k][j]) % MOD;
        return res;
    }
    void operator *= (matrix x) { *this = *this * x; }
    // void print(){puts("print:------------");for(int i=1;i<=7;++i,puts(""))for(int j=1;j<=7;++j)printf("%-2d",a[j][i]);puts("------------------");}
};
int n, x, t[103];
matrix ans(1, 101), base(101, 101);
int main() {
    scanf("%d%d", &n, &x);
    for (int i = 1, a; i <= n; ++i) scanf("%d", &a), ++t[a];
    base.a[1][1] = 1;
    for (int i = 1; i <= 100; ++i)
        base.a[i + 1][1] = base.a[i + 1][2] = t[i];
    for (int i = 3; i <= 101; ++i) base.a[i - 1][i] = 1;
    // base.print();
    ans.a[1][2] = ans.a[1][1] = 1;
    // ans.print();
    // for (int i = 1; i <= x; ++i) {
    //     ans *= base;
    //     ans.print();
    // }
    for (; x; x >>= 1, base *= base)
        if (x & 1) ans *= base;
    printf("%d\n", ans.a[1][1]);
    return 0;
}


#include <bits/stdc++.h>
#define int long long
using namespace std;

int MOD = 1e9 + 7;

struct Matrix {
    int n, m;
    vector < vector <int> > mat;
    Matrix(vector < vector <int> > M) : mat(M), n(M.size()), m(M[0].size()) {}
    static Matrix id(int n) {
        vector < vector <int> > I(n, vector <int> (n, 0));
            for(int i = 0; i < n; i++) {
                I[i][i] = 1;
            }
        return Matrix(I);
    }
    Matrix operator * (Matrix A) {
        int N = n;
        int M = A.m;
        int O = m;
        vector < vector <int> > Temp(N, vector <int> (M, 0));
        for(int i = 0; i < N; i++) {
            for(int j = 0; j < M; j++) {
                for(int k = 0; k < O; k++) {
                    Temp[i][j] = (Temp[i][j] + mat[i][k] * A.mat[k][j]) % MOD;
                }
            }
        }
        return Matrix(Temp);
    }
    friend ostream& operator << (ostream &out, Matrix A) ;
};

ostream& operator << (ostream &out, Matrix A) {
    for(int i = 0; i < A.n; i++, cout << endl) {
        for(int j = 0; j < A.m; j++) {
            cout << A.mat[i][j] << " ";
        }
    }
}

Matrix POW(int n, Matrix M, int l) {
    Matrix ret = M.id(l);
    while(n) {
        if(n & 1) {
            ret = ret * M;
        }
        n /= 2;
        M = M * M;
    }
    return ret;
}

int32_t main() {
    ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n, x; cin >> n >> x;
    vector <vector <int> > f(1, vector <int> (100, 0));
    for(int i = 0; i < n; ++i) {
        int y; cin >> y; f[0][y - 1]++;

    }

    vector <vector <int> > d(1, vector <int> (101, 0)), e(101, vector <int> (101, 0));
    d[0][0] = 1;
    for(int i = 0; i < 100; i++) {
        e[i][0] = f[0][i];
    }
    for(int i = 1; i < 100; i++) {
        e[i - 1][i] = 1;
    }
    e[0][100] = e[100][100] = 1;

    Matrix dd = Matrix(d) * POW(x + 1, Matrix(e), 101);

    cout << dd.mat[0][100] << endl;

}


#include <bits/stdc++.h>

using namespace std;

const int MOD = 1e9+7;

struct Matrix
{
	vector< vector<int> > mat; // the contents of matrix as a 2D-vector
	int n_rows, n_cols; // number of rows and columns

	Matrix(vector< vector<int> > values) : mat(values), n_rows(values.size()),
		n_cols(values[0].size()) {}

	static Matrix identity_matrix(int n)
	{
		// Return I_n - the identity matrix of size n.
		// This function is static, because it creates a new Matrix instance
		vector< vector<int> > values(n, vector<int>(n, 0));
		for (int i = 0; i < n; i++)
			values[i][i] = 1;
		return values;
	}

	Matrix operator*(const Matrix &other) const
	{
		int n = n_rows, m = other.n_cols;
		vector< vector<int> > result(n_rows, vector<int>(m, 0));
		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++) {
				for (int k = 0; k < n_cols; k++) {
					result[i][j] = (result[i][j] + mat[i][k] * 1ll * other.mat[k][j]) % MOD;
				}
			}
		// Multiply matrices as usual, then return the result as the new Matrix
		return Matrix(result);
	}

	inline bool is_square() const
	{
		return n_rows == n_cols;
	}
};

Matrix fast_exponentiation(Matrix m, int power)
{
	assert(m.is_square());
	Matrix result = Matrix::identity_matrix(m.n_rows);

	while (power) {
		if (power & 1)
			result = result * m;
		m = m * m;
		power >>= 1;
	}

	return result;
}

int d[105]={};

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int n,x; cin >> n >> x;
	for(int i=0,v;i<n;i++){
		cin >> v;
		d[v]++;
	}
	vector<vector<int>> temp(101,vector<int>(101,0));
	for(int i=0;i<100;i++){
		temp[0][i]=d[i+1];
	}
	for(int i=1;i<100;i++){
		temp[i][i-1]=1;
	}
	temp[100][0]=1;
	temp[100][100]=1;

	Matrix mat(temp);
	mat=fast_exponentiation(mat,x+1);
	cout << mat.mat[100][0] << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MOD = 1e9+7;

struct Matrix
{
	vector< vector<int> > mat; // the contents of matrix as a 2D-vector
	int n_rows, n_cols; // number of rows and columns

	Matrix(vector< vector<int> > values) : mat(values), n_rows(values.size()),
		n_cols(values[0].size()) {}

	static Matrix identity_matrix(int n)
	{
		// Return I_n - the identity matrix of size n.
		// This function is static, because it creates a new Matrix instance
		vector< vector<int> > values(n, vector<int>(n, 0));
		for (int i = 0; i < n; i++)
			values[i][i] = 1;
		return values;
	}

	Matrix operator*(const Matrix &other) const
	{
		int n = n_rows, m = other.n_cols;
		vector< vector<int> > result(n_rows, vector<int>(m, 0));
		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++) {
				for (int k = 0; k < n_cols; k++) {
					result[i][j] = (result[i][j] + mat[i][k] * 1ll * other.mat[k][j]) % MOD;
				}
			}
		// Multiply matrices as usual, then return the result as the new Matrix
		return Matrix(result);
	}

	inline bool is_square() const
	{
		return n_rows == n_cols;
	}
};

Matrix fast_exponentiation(Matrix m, int power)
{
	assert(m.is_square());
	Matrix result = Matrix::identity_matrix(m.n_rows);

	while (power) {
		if (power & 1)
			result = result * m;
		m = m * m;
		power >>= 1;
	}

	return result;
}

int d[105]={};

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int n,x; cin >> n >> x;
	for(int i=0,v;i<n;i++){
		cin >> v;
		d[v]++;
	}
	vector<vector<int>> temp(101,vector<int>(101,0));
	for(int i=0;i<100;i++){
		temp[0][i]=d[i+1];
		temp[100][i]=d[i+1];
	}
	for(int i=1;i<100;i++){
		temp[i][i-1]=1;
	}
	temp[100][100]=1;

	Matrix mat(temp);
	mat=fast_exponentiation(mat,x);
	cout << mat.mat[100][0]+mat.mat[100][100] << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

template<const unsigned int N, const unsigned int M, typename T = int, T D = 1000 * 1000 * 1000 + 7>
    class mat {
        static_assert(is_integral<T>::value);
        private:
            unsigned int _n = 0, _m = 0;
        public:
            T a[N][M];
            inline unsigned int n() { return _n; }
            inline unsigned int m() { return _m; }
            void resize(unsigned int x, unsigned int y) {
                assert(x < N && y < M);
                _n = x, _m = y;
            }
            inline auto& operator [] (int x) { return a[x]; }
            mat<N, M, T, D> operator * (mat<N, M, T, D> y) {
                assert(m() == y.n());
                int tmp;
		        mat<N, M, T, D> r(n(), y.m());
    		    for (int i = 0; i < n(); i++)
                    for (int j = 0; j < y.m(); j++)
                        for (int k = 0; k < m(); k++)
                            r[i][j] = (((tmp = (1ll * a[i][k] * y[k][j] % D) + r[i][j]) < D)? tmp: tmp - D);
		        return r;
	        }
            mat<N, M, T, D> pw(unsigned int y) {
        		mat<N, M, T, D> x = *this;
                assert(x.n() == x.m());
    	    	mat<N, M, T, D> ans(x.n(), x.n(), true);
		        for (; y; y >>= 1, x = x * x)
		    	    if (y & 1)
	    			    ans = ans * x;
        		return ans;
	        }
            mat<N, M, T, D> (unsigned int x = 0, unsigned int y = 0, bool o = false) {
                assert(x < N && y < M);
                _n = x, _m = y;
                memset(a, 0, sizeof a);
                if (o) {
                    assert(x == y);
                    for (int i = 0; i < x; i++) a[i][i] = 1;
                }
            }
    };

const unsigned int MAXD = 100 + 3 + 2 + 1, MOD = 1000 * 1000 * 1000 + 7;

int cnt[MAXD], n, x;
mat<MAXD, MAXD> cal(MAXD - 1, MAXD - 1);

int main() {
    cin >> n >> x;
    for (int i = 0; i < n; i++) {
        int d;
        cin >> d;
        cnt[d]++;
    }
    for (int i = 1; i < 100; i++) cal[i - 1][i] = 1;
    cal[100][100] = 1, cal[100][0] = 1;
    for (int i = 0; i < 100; i++) cal[i][0] = cnt[i + 1];
    cal = cal.pw(x);
    cout << (cal[0][0] + cal[100][0]) % MOD << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#pragma optimize("-O3")
#define int long long int
#define f first
#define s second
#define pb push_back
#define endl '\n'
int dis[105];
int dp[105];

int S;
const int MOD=1000000007;
struct Matrix {
  vector<vector<int>> data;
  Matrix() :data(S, vector<int>(S)) {}
  Matrix Mul(const Matrix&rhs) const {
    Matrix ans;
    for (int i = 0; i < S; ++i) {
      for (int j = 0; j < S; ++j) {
        for (int k = 0; k < S; ++k) {
          ans.data[i][k] = (ans.data[i][k]
              + data[i][j] * rhs.data[j][k])%MOD;
        }
      }
    }
    return ans;
  }

  Matrix Pow(int n) const {
    Matrix ans;
    Matrix exp = *this;
    for (int i = 0; i < S; ++i) { ans.data[i][i] = 1; }
    while (n) {
      if (n & 1) { ans = ans.Mul(exp); }
      n >>= 1;
      exp = exp.Mul(exp);
    }
    return ans;
  }
};

main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int n, x;
	cin>>n>>x;
	for(int i=0; i<n; i++){
		int val;
		cin>>val;
		dis[val]++;
	}
	dp[0]=1;
	for(int i=1; i<=100; i++){
		for(int j=1; j<=100; j++){
			if(i>=j){
				dp[i]=(dp[i]+dis[j]*dp[i-j])%MOD;
			}
		}
	}

	S=102;
	Matrix mat;
	for(int i=0; i<102; i++){
		for(int j=0; j<102; j++){
			mat.data[i][j]=0;
		}
	}

	for(int i=0; i<100; i++){
		mat.data[i][i+1]=1;
	}
	for(int i=0; i<=100; i++){
		mat.data[100][i]=dis[101-i];
	}
	mat.data[101][101]=1;
	mat.data[101][0]=1;

	mat=mat.Pow(x+1);

	int ans=0;
	for(int i=0; i<=100; i++){
		ans=(ans+mat.data[101][i]*dp[i])%MOD;
	}
	cout<<ans<<endl;

	return 0;
}


/* -*- coding: utf-8 -*-
 *
 * 0514E.cc: E. Darth Vader and Tree
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int D = 100;
const int N = D + 1;
const int MOD = 1000000007;

/* typedef */

typedef long long ll;
typedef int vec[N];
typedef vec mat[N];

/* global variables */

int cs[D + 1], dp[D + 1];
mat ma, mb, mc;
vec va, vb;

/* subroutines */

inline void initmat(mat a) { memset(a, 0, sizeof(mat)); }

inline void unitmat(mat a) {
  initmat(a);
  for (int i = 0; i < N; i++) a[i][i] = 1;
}

inline void copymat(const mat a, mat b) { memcpy(b, a, sizeof(mat)); }

inline void mulmat(const mat a, const mat b, mat c) {
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++) {
      c[i][j] = 0;
      for (int k = 0; k < N; k++)
        c[i][j] = (c[i][j] + (ll)a[i][k] * b[k][j] % MOD) % MOD;
    }
}

inline void powmat(const mat a, int b, mat c) {
  mat s, t;
  copymat(a, s);
  unitmat(c);

  while (b > 0) {
    if (b & 1) {
      mulmat(c, s, t);
      copymat(t, c);
    }

    mulmat(s, s, t);
    copymat(t, s);
    b >>= 1;
  }
}

inline void mulmatvec(const mat a, const vec b, vec c) {
  for (int i = 0; i < N; i++) {
    c[i] = 0;
    for (int j = 0; j < N; j++)
      c[i] = (c[i] + (ll)a[i][j] * b[j] % MOD) % MOD;
  }
}

/* main */

int main() {
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);

  int n, x;
  scanf("%d%d", &n, &x);

  for (int i = 0; i < n; i++) {
    int di;
    scanf("%d", &di);
    cs[di]++;
  }

  int y = min(x, D);
  int dsum = dp[0] = 1;
  for (int i = 1; i <= y; i++) {
    for (int j = 1; j <= i; j++)
      dp[i] = (dp[i] + (ll)cs[j] * dp[i - j] % MOD) % MOD;
    dsum = (dsum + dp[i]) % MOD;
  }

  if (x <= D) {
    printf("%d\n", dsum);
    return 0;
  }

  initmat(ma);
  for (int i = 0; i + 1 < D; i++) ma[i][i + 1] = 1;
  for (int i = 0; i < D; i++) ma[D - 1][i] = ma[D][i] = cs[D - i];
  ma[D][D] = 1;

  powmat(ma, x - D, mb);

  for (int i = 0; i < D; i++) va[i] = dp[i + 1];
  va[D] = dsum;
  mulmatvec(mb, va, vb);

  printf("%d\n", vb[D]);
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define int long long
#define fo(i, a, b) for (int i = (a); i < (b); i++)
#define MOD 1000000007
#define N 123456

int n, x, a, cnt[N], cnt2[N] = {1};
int k = 11;

unordered_map<int, int> mp;

int upto(int b)
{
	if (b < N) return cnt2[b];

	if (mp.find(b) != mp.end()) return mp[b];

	int mid = b / 2;
	int res = upto(mid);

	fo(i, 1, 101) fo(j, 0, i) res = (res + (cnt[i] * (upto(mid - j) - upto(mid - j - 1) + MOD)) % MOD * upto(b - (mid - j) - i)) % MOD;

	return mp[b] = res;
}

signed main()
{
	cin >> n >> x;

	fo(i, 0, n) cin >> a, cnt[a]++;

	fo(i, 0, N - 1) fo(j, 1, min(N - i, k)) cnt2[i + j] = (cnt2[i + j] + cnt2[i] * cnt[j]) % MOD;

	fo(i, 1, N) cnt2[i] = (cnt2[i] + cnt2[i - 1]) % MOD;

	cout << upto(x);

	exit(0);
}


#include <bits/stdc++.h>
using namespace std;

#define int long long
#define fo(i, a, b) for (int i = (a); i < (b); i++)
#define MOD 1000000007
#define N 123456

int n, x, a, cnt[N], cnt2[N] = {1};
int k = 111;

unordered_map<int, int> m;

int upto(int b)
{
	if (b < N) return cnt2[b];

	if (m.find(b) != m.end()) return m[b];

	int mid = b / 2;
	int res = upto(mid);

	fo(i, 1, 101) fo(j, 0, i) res = (res + (cnt[i] * (upto(mid - j) - upto(mid - j - 1) + MOD)) % MOD * upto(b - (mid - j) - i)) % MOD;

	return m[b] = res;
}

signed main()
{
	cin >> n >> x;

	fo(i, 0, n) cin >> a, cnt[a]++;

	fo(i, 0, N - 1) fo(j, 1, min(N - i, k)) cnt2[i + j] = (cnt2[i + j] + cnt2[i] * cnt[j]) % MOD;

	fo(i, 1, N) cnt2[i] = (cnt2[i] + cnt2[i - 1]) % MOD;

	cout << upto(x);

	exit(0);
}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define repi(i, a, b) for(int i=(a); i>(b); i--)
#define db(x) (cerr << #x << ": " << (x) << '\n')
#define sync ios_base::sync_with_stdio(false), cin.tie(NULL)
#define cps CLOCKS_PER_SEC
#define tests(t) int t; cin >> t; while(t--)
#define iceil(n, x) (((n) + (x) - 1) / (x))
#define ll long long
#define gcd __gcd
#define eb emplace_back
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define sz size()
#define all(v) (v).begin(), (v).end()
#define uni(v) sort(all(v)), (v).erase(unique(all(v)), (v).end())
#define pii pair<int, int>
#define vi vector<int>
#define vpii vector<pii>
#define vvi vector<vi>
#define fi first
#define se second
#define mt make_tuple
#define pqueue priority_queue
#define bitcount(x) __builtin_popcount(x)
#define PI acos(-1.0)
#define EPS 1e-9
#define mod 1000000007
using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}

template<typename T1, typename T2>
ostream& operator << (ostream& os, const pair<T1, T2>& p) { return os << '(' << p.fi << ", " << p.se << ')'; }

template<typename T>
void printv(const T& v) { for(auto i : v) cerr << i << ' '; cerr << '\n'; }

template<typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;

template<typename T>
using maxpq = priority_queue<T>;

//All indexing is 0-based
using namespace __gnu_pbds;
template<class key, class cmp = std::less<key>>
using ordered_set = tree<key, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
//methods: find_by_order(k); & order_of_key(k);
//To make it an ordered_multiset, use pairs of (value, time_of_insertion)
//to distinguish values which are similar

template<class key, class value, class cmp = std::less<key>>
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;

//Returns no. of values x for which ceil(n / x) == y (y must be > 1).
inline ll CC(ll n, ll y) { return iceil(n, y-1) - iceil(n, y); }

//Returns no. of values x for which floor(n / x) == y
inline ll FF(ll n, ll y) { return n / y - n / (y+1); }

//a and b are assumed to be taken modulo p
inline int add(int a, int b, int p = mod){ int c = a + b; if(c >= p) c -= p; return c; }
inline int sub(int a, int b, int p = mod){ int c = a - b; if(c < 0) c += p; return c; }
inline int mul(int a, int b, int p = mod){ return (a * 1ll * b) % p; }

#define N 1005
#define int ll
// #define trace(...) 42

const int m = 100;
int n, x;
int dp[N], freq[N];

#define K 101 //Max. size of the matrix.

//Performs the operation c = a * b
void mul(int a[K][K], int b[K][K], int c[K][K], int z = K) {
    for(int i = 0; i < z; i++) {
        for(int j = 0; j < z; j++) {
            c[i][j] = 0;
            for(int k = 0; k < z; k++) {
                c[i][j] = add(c[i][j], mul(a[i][k], b[k][j]));
            }
        }
    }
}

//Computes a ** k and stores in b
//Note: a and b must be different arrays.
//z: size of the matrix we are working with currently.
void power(int a[K][K], ll k, int b[K][K], int z = K) {
    int temp[K][K], a_temp[K][K];

    memcpy(a_temp, a, sizeof a_temp);

    for(int i = 0; i < z; i++)
        for(int j = 0; j < z; j++)
            b[i][j] = i == j ? 1 : 0;
    while(k) {
        if(k & 1) {
            mul(a, b, temp, z);
            memcpy(b, temp, sizeof temp);
        }
        mul(a, a, temp, z);
        memcpy(a, temp, sizeof temp);
        k >>= 1;
    }

    memcpy(a, a_temp, sizeof a_temp);
}

int a[K][K], b[K][K];

main()
{
    #ifndef ONLINE_JUDGE
        freopen("/home/tarun/Desktop/input.txt", "r", stdin);
     // freopen("/home/tarun/Desktop/output.txt", "w", stdout);
    #endif
    sync;
    clock_t clk = clock();
    cerr << "I will return...\n";

    cin >> n >> x;
    rep(i, 0, n) {
        int j; cin >> j;
        ++freq[j];
    }

    dp[0] = 1;
    for(int i = 1; i <= m; i++) {
        int& ans = dp[i];
        for(int j = 1; j <= i; j++) {
            // trace(j, freq[j], dp[j-i]);
            ans = add(ans, mul(freq[j], dp[i-j]));
        }
        ++ans;
        // trace(i, dp[i]);
    }

    if(x <= m) {
        cout << dp[x] << '\n';
    }
    else {
        rep(i, 0, K-1) a[0][i] = freq[i+1];
        a[0][K-1] = 1;
        rep(i, 1, K-1) {
            a[i][i-1] = 1;
        }
        a[K-1][K-1] = 1;

        // rep(i, 0, K) {
        //     rep(j, 0, K) cout << a[i][j]; cout << '\n';
        // }

        power(a, x-m, b);

        int ans = 0;
        rep(i, 0, K) {
            ans = add(ans, mul(b[0][i], dp[m-i]));
        }
        cout << ans << '\n';
    }

    cerr << "...don't you ever hang your head.\n";
    cerr << "Time (in ms): " << (double)(clock() - clk) * 1000.0 / cps << '\n';
}

//Compile using:
//g++ -o filename.exe --std=c++11 filename.cpp
//Use -D CP for defining a macro CP in the local environment


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define repi(i, a, b) for(int i=(a); i>(b); i--)
#define db(x) (cerr << #x << ": " << (x) << '\n')
#define sync ios_base::sync_with_stdio(false), cin.tie(NULL)
#define cps CLOCKS_PER_SEC
#define tests(t) int t; cin >> t; while(t--)
#define iceil(n, x) (((n) + (x) - 1) / (x))
#define ll long long
#define gcd __gcd
#define eb emplace_back
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define sz size()
#define all(v) (v).begin(), (v).end()
#define uni(v) sort(all(v)), (v).erase(unique(all(v)), (v).end())
#define pii pair<int, int>
#define vi vector<int>
#define vpii vector<pii>
#define vvi vector<vi>
#define fi first
#define se second
#define mt make_tuple
#define pqueue priority_queue
#define bitcount(x) __builtin_popcount(x)
#define PI acos(-1.0)
#define EPS 1e-9
#define mod 1000000007
using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}

template<typename T1, typename T2>
ostream& operator << (ostream& os, const pair<T1, T2>& p) { return os << '(' << p.fi << ", " << p.se << ')'; }

template<typename T>
void printv(const T& v) { for(auto i : v) cerr << i << ' '; cerr << '\n'; }

template<typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;

template<typename T>
using maxpq = priority_queue<T>;

//All indexing is 0-based
using namespace __gnu_pbds;
template<class key, class cmp = std::less<key>>
using ordered_set = tree<key, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
//methods: find_by_order(k); & order_of_key(k);
//To make it an ordered_multiset, use pairs of (value, time_of_insertion)
//to distinguish values which are similar

template<class key, class value, class cmp = std::less<key>>
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;

//Returns no. of values x for which ceil(n / x) == y (y must be > 1).
inline ll CC(ll n, ll y) { return iceil(n, y-1) - iceil(n, y); }

//Returns no. of values x for which floor(n / x) == y
inline ll FF(ll n, ll y) { return n / y - n / (y+1); }

//a and b are assumed to be taken modulo p
inline int add(int a, int b, int p = mod){ int c = a + b; if(c >= p) c -= p; return c; }
inline int sub(int a, int b, int p = mod){ int c = a - b; if(c < 0) c += p; return c; }
inline int mul(int a, int b, int p = mod){ return (a * 1ll * b) % p; }

#define N 1005
#define int ll
// #define trace(...) 42

const int m = 100;
int n, x;
int dp[N], freq[N];

#define K 101 //Max. size of the matrix.

//Performs the operation c = a * b
void mul(int a[K][K], int b[K][K], int c[K][K], int z = K) {
    for(int i = 0; i < z; i++) {
        for(int j = 0; j < z; j++) {
            c[i][j] = 0;
            for(int k = 0; k < z; k++) {
                c[i][j] = add(c[i][j], mul(a[i][k], b[k][j]));
            }
        }
    }
}

//Computes a ** k and stores in b
//Note: a and b must be different arrays.
//z: size of the matrix we are working with currently.
void power(int a[K][K], ll k, int b[K][K], int z = K) {
    int temp[K][K], a_temp[K][K];

    memcpy(a_temp, a, sizeof a_temp);

    for(int i = 0; i < z; i++)
        for(int j = 0; j < z; j++)
            b[i][j] = i == j ? 1 : 0;
    while(k) {
        if(k & 1) {
            mul(a, b, temp, z);
            memcpy(b, temp, sizeof temp);
        }
        mul(a, a, temp, z);
        memcpy(a, temp, sizeof temp);
        k >>= 1;
    }

    memcpy(a, a_temp, sizeof a_temp);
}

int a[K][K], b[K][K];

main()
{
    #ifndef ONLINE_JUDGE
        freopen("/home/tarun/Desktop/input.txt", "r", stdin);
     // freopen("/home/tarun/Desktop/output.txt", "w", stdout);
    #endif
    sync;
    clock_t clk = clock();
    cerr << "I will return...\n";

    cin >> n >> x;
    rep(i, 0, n) {
        int j; cin >> j;
        ++freq[j];
    }

    dp[0] = 1;
    for(int i = 1; i < m; i++) {
        int& ans = dp[i];
        for(int j = 1; j <= i; j++) {
            // trace(j, freq[j], dp[j-i]);
            ans = add(ans, mul(freq[j], dp[i-j]));
        }
        ++ans;
        // trace(i, dp[i]);
    }

    if(x < m) {
        cout << dp[x] << '\n';
    }
    else {
        rep(i, 0, K-1) a[0][i] = freq[i+1];
        a[0][K-1] = 1;
        rep(i, 1, K-1) {
            a[i][i-1] = 1;
        }
        a[K-1][K-1] = 1;

        // rep(i, 0, K) {
        //     rep(j, 0, K) cout << a[i][j]; cout << '\n';
        // }

        power(a, x-m+1, b);

        int ans = 0;
        rep(i, 0, K-1) {
            ans = add(ans, mul(b[0][i], dp[m-1-i]));
        }
        ans = add(ans, b[0][K-1]);
        cout << ans << '\n';
    }

    cerr << "...don't you ever hang your head.\n";
    cerr << "Time (in ms): " << (double)(clock() - clk) * 1000.0 / cps << '\n';
}

//Compile using:
//g++ -o filename.exe --std=c++11 filename.cpp
//Use -D CP for defining a macro CP in the local environment


#include <bits/stdc++.h>

#define endl "\n"
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;

constexpr int N = 1e2+5;
constexpr ll mod = 1e9+7;

struct M
{
  vector<vector<ll>> m;
  M(int n)
  {
    for (int i = 0; i < n; i++)
      m.emplace_back(vector<ll>(n));
  }
  M& operator*=(const M& b)
  {
    M res(m.size());
    int n = b.m.size();
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++)
        for (int k = 0; k < n; k++)
          res.m[i][j] += (m[i][j]*b.m[k][j])%mod, res.m[i][j] %= mod;
    this->m = res.m;
  }
};

void binpow(M& a, int deg)
{
  M b = a;
  for (int i = 0; i < a.m.size(); i++)
    for (int j = 0; j < a.m.size(); j++)
      a.m[i][j] = (i==j);
  while(deg)
  {
    if (deg&1)
      a*=b;
    b*=b;
    deg>>=1;
  }
}

ll n, x, dp[N], cnt[N], ans = 0;

void Solve()
{
  cin >> n >> x;
  for (int i = 0, v; i < n; i++)
    cin >> v, cnt[v]++;
  dp[0] = 1;
  for (int i = 0; i <= 100; i++)
  {
    for (int j = 1; j <= i; j++)
      dp[i]+=(cnt[j]*dp[i-j])%mod, dp[i]%=mod;
    ans += dp[i], ans %= mod;
  }
  if (x <= 100)
  {
    ans = 0;
    for (int i = 0; i <= x; i++)
      ans += dp[i], ans %= mod;
    cout << ans;
    return;
  }
  M a(101);
  for (int i = 0; i < 100; i++)
    a.m[i+1][i] = 1;
  for (int i = 0; i < 100; i++)
    a.m[99][i] = a.m[100][i] = cnt[100-i];
  a.m[100][100] = 1;
  binpow(a, x-100);
  for (int i = 1; i <= 100; i++)
    ans += (a.m[100][100-i+1]*dp[i])%mod, ans %= mod;
  cout << ans;
}

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  Solve();
  return 0;
}


#include <bits/stdc++.h>

#define endl "\n"
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;

constexpr int N = 1e2+5;
constexpr ll mod = 1e9+7;

struct M
{
  vector<vector<ll>> m;
  M(int n)
  {
    for (int i = 0; i < n; i++)
      m.emplace_back(vector<ll>(n));
  }
  M& operator*=(const M& b)
  {
    M res(m.size());
    int n = b.m.size();
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++)
        for (int k = 0; k < n; k++)
          res.m[i][j] += (m[i][k]*b.m[k][j])%mod, res.m[i][j] %= mod;
    this->m = res.m;
  }
};

void binpow(M& a, int deg)
{
  M b = a;
  for (int i = 0; i < a.m.size(); i++)
    for (int j = 0; j < a.m.size(); j++)
      a.m[i][j] = (i==j);
  while(deg)
  {
    if (deg&1)
      a*=b;
    b*=b;
    deg>>=1;
  }
}

ll n, x, dp[N], cnt[N], ans = 0;

void Solve()
{
  cin >> n >> x;
  for (int i = 0, v; i < n; i++)
    cin >> v, cnt[v]++;
  dp[0] = 1;
  for (int i = 0; i <= 100; i++)
  {
    for (int j = 1; j <= i; j++)
      dp[i]+=(cnt[j]*dp[i-j])%mod, dp[i]%=mod;
    ans += dp[i], ans %= mod;
  }
  if (x <= 100)
  {
    ans = 0;
    for (int i = 0; i <= x; i++)
      ans += dp[i], ans %= mod;
    cout << ans;
    return;
  }
  M a(101);
  for (int i = 0; i < 99; i++)
    a.m[i+1][i] = 1;
  for (int i = 0; i < 100; i++)
    a.m[i][99] = a.m[i][100] = cnt[100-i];
  a.m[100][100] = 1;
  binpow(a, x-100);
  for (int i = 1; i <= 100; i++)
    ans += (a.m[i-1][100]*dp[i])%mod, ans %= mod;
  cout << ans;
}

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  Solve();
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define maxn 107
#define int long long
const int mod=1e9+7;
int n,x;
int cnt[maxn];
int dp[maxn];
struct matrix{
    #define m 102
    int a[m][m];
    void init(){
        memset(a,0,sizeof(a));
        for(int i=1;i<m;i++)a[i][i]=1;
    }
    matrix operator * (const matrix &x)const{
        matrix y;
        memset(y.a,0,sizeof(y.a));
        for(int i=1;i<m;i++)for(int j=1;j<m;j++)for(int k=1;k<m;k++){y.a[i][j]+=a[i][k]*x.a[k][j];y.a[i][j]%=mod;}
        return y;
    }
    matrix operator = (const matrix &x){
        for(int i=1;i<m;i++)
            for(int j=1;j<m;j++)
                a[i][j]=x.a[i][j];
        return *this;
    }
    void print(){
        for(int i=1;i<m;i++){
            for(int j=1;j<m;j++)cout<<a[i][j];
            cout<<endl;
        }
    }
    #undef m
};
matrix q_pow(matrix m,int num){
    matrix ans;ans.init();
    for(;num;num>>=1,m=m*m){
        if(num&1){
            ans=ans*m;
        }
    }
    return ans;
}
main(){
    scanf("%lld%lld",&n,&x);
    for(int i=1;i<=n;i++){
        int d;
        scanf("%lld",&d);
        cnt[d]++;
    }
    matrix ma;
    dp[0]=1;
    for(int i=1;i<=100;i++){
        for(int j=1;j<=i;j++){
            (dp[i]+=dp[i-j]*cnt[j])%=mod;
        }
    }
    if(x<=100){
        int ans=0;
        for(int i=0;i<=x;i++)
            ans=(ans+dp[i])%mod;
        cout<<ans<<endl;
        return 0;
    }
    for(int i=1;i<=99;i++){
        ma.a[i][i+1]=1;
    }
    for(int i=1;i<=100;i++){
        ma.a[100][i]=cnt[101-i];
        ma.a[101][i]=cnt[101-i];
    }
    ma.a[101][101]=1;
    int sum=0;
    for(int i=0;i<=100;i++){
        (sum+=dp[i])%=mod;
    }
    ma=q_pow(ma,x-100);
    int ans=0;
    for(int i=1;i<=100;i++){
        (ans+=ma.a[101][i]*dp[i]%mod)%=mod;
    }
    ans+=ma.a[101][101]*sum%mod;
    cout<<(ans)%mod<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define maxn 107
#define int long long
const int mod=1e9+7;
int n,x;
int cnt[maxn];
int dp[maxn];
struct matrix{
    #define m 101
    int a[m][m];
    void init(){
        memset(a,0,sizeof(a));
        for(int i=1;i<m;i++)a[i][i]=1;
    }
    matrix operator * (const matrix &x)const{
        matrix y;
        memset(y.a,0,sizeof(y.a));
        for(int i=1;i<m;i++)for(int j=1;j<m;j++)for(int k=1;k<m;k++){y.a[i][j]+=a[i][k]*x.a[k][j];y.a[i][j]%=mod;}
        return y;
    }
    matrix operator = (const matrix &x){
        for(int i=1;i<m;i++)
            for(int j=1;j<m;j++)
                a[i][j]=x.a[i][j];
        return *this;
    }
    void print(){
        for(int i=1;i<m;i++){
            for(int j=1;j<m;j++)cout<<a[i][j];
            cout<<endl;
        }
    }
    #undef m
};
matrix q_pow(matrix m,int num){
    matrix ans;ans.init();
    for(;num;num>>=1,m=m*m){
        if(num&1){
            ans=ans*m;
        }
    }
    ans.print();
    return ans;
}
main(){
    scanf("%lld%lld",&n,&x);
    for(int i=1;i<=n;i++){
        int d;
        scanf("%lld",&d);
        cnt[d]++;
    }
    matrix now;
    matrix ma;
    dp[0]=1;
    for(int i=1;i<=100;i++){
        for(int j=1;j<=i;j++){
            (dp[i]+=dp[i-j]*cnt[j])%=mod;
        }
    }
    for(int i=1;i<=100;i++){
        now.a[i][1]=dp[i];
    }
    for(int i=1;i<=100;i++){
        for(int j=1;j<=100;j++){
            if(i!=100){
                if(j-i==1)ma.a[i][j]=1;
                else ma.a[i][j]=0;
            }else{
                ma.a[i][j]=cnt[100-j+1];
            }
        }
    }
    if(x<=100){
        int ans=0;
        for(int i=1;i<=x;i++)
            ans=(ans+dp[i])%mod;
        cout<<ans+1<<endl;
        return 0;
    }
    now.print();
    now=q_pow(ma,x-100)*now;
    int ans=0;
    for(int i=1;i<=100;i++){
        (ans+=now.a[i][1])%=mod;
    }
    cout<<ans+1<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define maxn 107
#define int long long
const int mod=1e9+7;
int n,x;
int cnt[maxn];
int dp[maxn];
struct matrix{
    #define m 101
    int a[m][m];
    void init(){
        memset(a,0,sizeof(a));
        for(int i=1;i<m;i++)a[i][i]=1;
    }
    matrix operator * (const matrix &x)const{
        matrix y;
        memset(y.a,0,sizeof(y.a));
        for(int i=1;i<m;i++)for(int j=1;j<m;j++)for(int k=1;k<m;k++){y.a[i][j]+=a[i][k]*x.a[k][j];y.a[i][j]%=mod;}
        return y;
    }
    matrix operator = (const matrix &x){
        for(int i=1;i<m;i++)
            for(int j=1;j<m;j++)
                a[i][j]=x.a[i][j];
        return *this;
    }
    void print(){
        for(int i=1;i<m;i++){
            for(int j=1;j<m;j++)cout<<a[i][j];
            cout<<endl;
        }
    }
    #undef m
};
matrix q_pow(matrix m,int num){
    matrix ans;ans.init();
    for(;num;num>>=1,m=m*m){
        if(num&1){
            ans=ans*m;
        }
    }
    ans.print();
    return ans;
}
main(){
    scanf("%lld%lld",&n,&x);
    for(int i=1;i<=n;i++){
        int d;
        scanf("%lld",&d);
        cnt[d]++;
    }
    matrix now;
    matrix ma;
    dp[0]=1;
    for(int i=1;i<=100;i++){
        for(int j=1;j<=i;j++){
            (dp[i]+=dp[i-j]*cnt[j])%=mod;
        }
    }
    for(int i=1;i<=100;i++){
        now.a[i][1]=dp[i];
    }
    for(int i=1;i<=100;i++){
        for(int j=1;j<=100;j++){
            if(i!=100){
                if(j-i==1)ma.a[i][j]=1;
                else ma.a[i][j]=0;
            }else{
                ma.a[i][j]=cnt[100-j+1];
            }
        }
    }
    if(x<=100){
        int ans=0;
        for(int i=1;i<=x;i++)
            ans=(ans+dp[i])%mod;
        cout<<ans+1<<endl;
        return 0;
    }
    now=q_pow(ma,x-100)*now;
    int ans=0;
    for(int i=1;i<=100;i++){
        (ans+=now.a[i][1])%=mod;
    }
    cout<<ans+1<<endl;
    return 0;
}


#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp> //required
// #include <ext/pb_ds/tree_policy.hpp> //required

// using namespace __gnu_pbds;
using namespace std;

#define st first
#define nd second
void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}
// template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;  // ordered_set <long long> s; // order_of_key(value)

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(long long _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"

const long long N = 110;
const long long MOD = 1e9 + 7;
long long n, k, m, a, b, s, dp[N + 1], x, cnt[N];

template<class T>
class Matrix {
public:
	long long n;
	vector <vector<T>> v;

	Matrix(long long _n) {
		n = _n;
		v = vector <vector <T> > (n, vector <T>(n, 0));
	}

	Matrix() {Matrix(5);}

	Matrix Id() {
		Matrix ans(n);
		for(long long i = 0; i < n; i++)
			ans.v[i][i] = 1;
		return ans;
	}

	Matrix operator+(Matrix &m) {
		Matrix ans(n);
		for(long long i = 0; i < n; i++)
			for(long long j = 0; j < n; j++) {
				ans.v[i][j] = m.v[i][j] + v[i][j];
				ans.v[i][j] %= MOD;
			}
		return ans;
	}

	Matrix operator*(Matrix &m) {
		Matrix ans(n);
		for(long long i = 0; i < n; i++)
			for(long long j = 0; j < n; j++)
				for(long long k = 0; k < n; k++) {
					ans.v[i][j] += m.v[i][k] * v[k][j];
					ans.v[i][j] %= MOD;
				}
		return ans;
	}

	vector <T> operator*(vector <T> v) {
		vector <T> res(n, 0);
		assert(v.size() >= n);
		for(long long i = 0; i < n; i++)
			for(long long j = 0; j < n; j++) {
				res[i] += v[j] * this->v[j][i];
				res[i] %= MOD;
			}
		return res;
	}

	Matrix operator^(long long exp) {
		if(exp == 0) return Id();
		if(exp == 1) return (*this);

		Matrix ans = (*this) ^ (exp / 2);
		ans = ans * ans;
		if(exp % 2)
			ans = ans * (*this);

		return ans;
	}
};

int main() {
	ios_base::sync_with_stdio(false);

	cin >> n >> x;
	for(long long i = 1; i <= n; i++)
		cin >> a, cnt[a]++;

	Matrix<long long> m(101);
	vector <long long> v;

	for(long long i = 0; i < 101; i++)
		for(long long j = 0; j < 99; j++)
			if(i == j + 1) m.v[i][j] = 1;

	for(long long i = 0; i < 100; i++)
		m.v[i][99] = m.v[i][100] = cnt[100 - i];

	m.v[100][100] = 1;

	dp[0] = 1;

	for(long long i = 1; i <= 100; i++) {
		for(long long j = 0; j < i; j++) {
			dp[i] += dp[j] * cnt[i - j];
			dp[i] %= MOD;
		}
		v.push_back(dp[i]);
		s += dp[i];
		s %= MOD;
	}

	v.push_back(s);
	// dbg(v);

	long long ans = 0;
	if(x <= 100) {
		for(long long i = 1; i <= x; i++)
			ans += dp[i];
	} else {
		auto r = (m ^ (x - 100)) * v;
		ans = r.back();
	}
	cout << (ans + 1) % MOD << '\n';
}


#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp> //required
// #include <ext/pb_ds/tree_policy.hpp> //required

// using namespace __gnu_pbds;
using namespace std;

#define st first
#define nd second
void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}
// template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;  // ordered_set <int> s; // order_of_key(value)

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"

const int N = 110;
const int MOD = 1e9 + 7;
int n, k, m, a, b, s, dp[N + 1], x, cnt[N];

template<class T>
class Matrix {
public:
	int n;
	vector <vector<T>> v;

	Matrix(int _n) {
		n = _n;
		v = vector <vector <T> > (n, vector <T>(n, 0));
	}

	Matrix() {Matrix(5);}

	Matrix Id() {
		Matrix ans(n);
		for(int i = 0; i < n; i++)
			ans.v[i][i] = 1;
		return ans;
	}

	Matrix operator+(Matrix &m) {
		Matrix ans(n);
		for(int i = 0; i < n; i++)
			for(int j = 0; j < n; j++) {
				ans.v[i][j] = m.v[i][j] + v[i][j];
				ans.v[i][j] %= MOD;
			}
		return ans;
	}

	Matrix operator*(Matrix &m) {
		Matrix ans(n);
		for(int i = 0; i < n; i++)
			for(int j = 0; j < n; j++)
				for(int k = 0; k < n; k++) {
					ans.v[i][j] += m.v[i][k] * v[k][j];
					ans.v[i][j] %= MOD;
				}
		return ans;
	}

	vector <T> operator*(vector <T> v) {
		vector <T> res(n, 0);
		assert(v.size() >= n);
		for(int i = 0; i < n; i++)
			for(int j = 0; j < n; j++) {
				res[i] += v[j] * this->v[j][i];
				res[i] %= MOD;
			}
		return res;
	}

	Matrix operator^(int exp) {
		if(exp == 0) return Id();
		if(exp == 1) return (*this);

		Matrix ans = (*this) ^ (exp / 2);
		ans = ans * ans;
		if(exp % 2)
			ans = ans * (*this);

		return ans;
	}
};

int main() {
	ios_base::sync_with_stdio(false);

	cin >> n >> x;
	for(int i = 1; i <= n; i++)
		cin >> a, cnt[a]++;

	Matrix<long long> m(101);
	vector <long long> v;

	for(int i = 0; i < 101; i++)
		for(int j = 0; j < 99; j++)
			if(i == j + 1) m.v[i][j] = 1;

	for(int i = 0; i < 100; i++)
		m.v[i][99] = m.v[i][100] = cnt[100 - i];

	m.v[100][100] = 1;

	dp[0] = 1;

	for(int i = 1; i <= 100; i++) {
		for(int j = 0; j < i; j++) {
			dp[i] += dp[j] * cnt[i - j];
			dp[i] %= MOD;
		}
		v.push_back(dp[i]);
		s += dp[i];
	}

	v.push_back(s);
	// dbg(v);

	int ans = 0;
	if(x <= 100) {
		for(int i = 1; i <= x; i++)
			ans += dp[i];
	} else {
		auto r = (m ^ (x - 100)) * v;
		ans = r.back();
	}
	cout << (ans + 1) % MOD << '\n';
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int   ll;
typedef pair<ll, ll>    pll;
typedef pair<int, int>  pii;

#define all(x)          x.begin(), x.end()
#define kill(x)         return cout << x << endl, 0
#define X               first
#define Y               second
#define sep             ' '
#define endl            '\n'

ll pw(ll a, ll b, ll mod) {
    if (!b)    return 1;
    if (b & 1) return a * pw(a * a % mod, b / 2, mod) % mod;
    return pw(a * a % mod, b / 2, mod) % mod;
}

const ll N    = 1e5 + 10;
const ll M    = 101;
const ll MOD  = 1e9 + 7;
const ll INF  = 1e18;

typedef vector<vector<ll>> Mat;

Mat makeMat(int n, int m) {
    return Mat(n, vector<ll>(m));
}

Mat operator*(const Mat& a, const Mat& b) {
    int n = a.size(), m = a[0].size(), c = b[0].size();
    Mat res = makeMat(n, c);
    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
            for (int k = 0; k < c; k++)
                res[i][k] = (res[i][k] + a[i][j] * b[j][k] % MOD) % MOD;
    return res;
}

Mat& operator*=(Mat& a, const Mat& b) {
    return a = a * b;
}

Mat pw(Mat m, ll p) {
    int n = m.size();
    Mat res = makeMat(n, n);
    for (int i = 0; i < n; i++)
        res[i][i] = 1;
    for (; p; p /= 2, m *= m)
        if (p & 1)
            res *= m;
    return res;

}

ll n, x, cnt[M];

int main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    cin >> n >> x;
    for (int i = 0; i < n; i++) {
        int y; cin >> y;
        cnt[y]++;
    }

    Mat A = makeMat(M, 1);
    A[0][0] = A[M - 1][0] = 1;

    Mat B = makeMat(M, M);
    for (int i = 1; i <= 100; i++)
        B[0][i - 1] = cnt[i];
    B[0][M - 1] = 1;
    for (int j = 1; j < M - 1; j++)
        B[j][j - 1] = 1;
    B[M - 1][M - 1] = 1;

    Mat C = pw(B, x) * A;
    cout << C[0][0] << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int   ll;
typedef pair<ll, ll>    pll;
typedef pair<int, int>  pii;

#define all(x)          x.begin(), x.end()
#define kill(x)         return cout << x << endl, 0
#define X               first
#define Y               second
#define sep             ' '
#define endl            '\n'

ll pw(ll a, ll b, ll mod) {
    if (!b)    return 1;
    if (b & 1) return a * pw(a * a % mod, b / 2, mod) % mod;
    return pw(a * a % mod, b / 2, mod) % mod;
}

typedef vector<vector<ll>> Mat;

Mat makeMat(int n, int m) {
    return Mat(n, vector<ll>(m));
}

Mat& operator+=(Mat& a, const Mat& b) {
    for (int i = 0; i < a.size(); i++)
        for (int j = 0; j < a[0].size(); j++)
            a[i][j] += b[i][j];
    return a;
}

Mat& operator-=(Mat& a, const Mat& b) {
    for (int i = 0; i < a.size(); i++)
        for (int j = 0; j < a[0].size(); j++)
            a[i][j] -= b[i][j];
    return a;
}

Mat operator*(const Mat& a, const Mat& b) {
    int n = a.size(), m = a[0].size(), c = b[0].size();
    Mat res = makeMat(n, c);
    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
            for (int k = 0; k < c; k++)
                res[i][k] += a[i][j] * b[j][k];
    return res;
}

Mat operator+(Mat a, const Mat& b) {
    return a += b;
}

Mat operator-(Mat a, const Mat& b) {
    return a -= b;
}

Mat& operator*=(Mat& a, const Mat& b) {
    return a = a * b;
}

Mat pw(Mat m, ll p) {
    int n = m.size();
    Mat res = makeMat(n, n);
    for (int i = 0; i < n; i++)
        res[i][i] = 1;
    for (; p; p /= 2, m *= m)
        if (p & 1)
            res *= m;
    return res;

}

const ll N    = 1e5 + 10;
const ll M    = 101;
const ll MOD  = 1e9 + 7;
const ll INF  = 1e18;

ll n, x, cnt[M];

int main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    cin >> n >> x;
    for (int i = 0; i < n; i++) {
        int y; cin >> y;
        cnt[y]++;
    }

    Mat A = makeMat(M, 1);
    A[0][0] = A[M - 1][0] = 1;

    Mat B = makeMat(M, M);
    for (int i = 1; i <= 100; i++)
        B[0][i - 1] = cnt[i];
    B[0][M - 1] = 1;
    for (int j = 1; j < M - 1; j++)
        B[j][j - 1] = 1;
    B[M - 1][M - 1] = 1;

    Mat C = pw(B, x) * A;
    cout << C[0][0] << endl;
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<string>
#include<queue>
#include<bitset>
#include<map>
#include<set>
#define ll long long
#define llu unsigned ll
#define pr make_pair
#define pb push_back
#define ui unsigned int
#define lc (cnt<<1)
#define rc (cnt<<1|1)
#define len(x)  (t[(x)].r-t[(x)].l+1)
#define tmid ((l+r)>>1)
#define forhead(x) for(int i=head[(x)];i;i=nt[i])
#define max(x,y) ((x)>(y)?(x):(y))
#define min(x,y) ((x)>(y)?(y):(x))
using namespace std;
const int inf=0x3f3f3f3f;
const ll lnf=0x3f3f3f3f3f3f3f3f;
const double dnf=1e18;
const int mod=1e9+7;
const double eps=1e-8;
const double pi=acos(-1.0);
const int maxn=100100;
const int maxm=100100;
const int up=100000;
const int hashp=13331;
const int hashpp=131;

struct node
{
    ll a[110][110];
};

node operator * (const node &a,const node &b)
{
    node c;
    memset(c.a,0,sizeof(c.a));
    for(int i=1;i<=101;i++)
    {
        for(int j=1;j<=101;j++)
        {
            for(int k=1;k<=101;k++)
                c.a[i][j]=(c.a[i][j]+a.a[i][k]*b.a[k][j])%mod;
        }
    }
    return c;
}

node mypow(node a,ll b)
{
    node ans;
    memset(ans.a,0,sizeof(ans.a));
    for(int i=1;i<=101;i++)
        ans.a[i][i]=1;
    while(b)
    {
        if(b&1) ans=ans*a;
        a=a*a;
        b>>=1;
    }
    return ans;
}

ll d[maxn];
ll cnt[110],dp[110],sum[110];

int main(void)
{
    int n,x;
    scanf("%d%d",&n,&x);
    for(int i=1;i<=n;i++)
    {
        scanf("%lld",&d[i]);
        cnt[d[i]]++;
    }
    sum[0]=dp[0]=1;
    for(int i=1;i<=100;i++)
    {
        for(int j=1;j<=i;j++)
            dp[i]=(dp[i]+dp[i-j]*cnt[j])%mod;
        sum[i]=(sum[i-1]+dp[i])%mod;
    }
    if(x<=100)
    {
        printf("%lld\n",sum[x]);
        return 0;
    }
    node ans;
    memset(ans.a,0,sizeof(ans.a));
    for(int i=1;i<=99;i++)
        ans.a[i][i+1]=1;
    for(int i=1;i<=100;i++)
        ans.a[101][i]=ans.a[100][i]=cnt[100-i+1];
    ans.a[101][101]=1;
    ans=mypow(ans,x-100);
    ll res=0;
    for(int i=1;i<=100;i++)
        res=(res+dp[i]*ans.a[101][i])%mod;
    res=(res+sum[100]*ans.a[101][101])%mod;
    printf("%lld\n",res);
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<string>
#include<queue>
#include<bitset>
#include<map>
#include<set>
#define ll long long
#define llu unsigned ll
#define pr make_pair
#define pb push_back
#define ui unsigned int
#define lc (cnt<<1)
#define rc (cnt<<1|1)
#define len(x)  (t[(x)].r-t[(x)].l+1)
#define tmid ((l+r)>>1)
#define forhead(x) for(int i=head[(x)];i;i=nt[i])
#define max(x,y) ((x)>(y)?(x):(y))
#define min(x,y) ((x)>(y)?(y):(x))
using namespace std;
const int inf=0x3f3f3f3f;
const ll lnf=0x3f3f3f3f3f3f3f3f;
const double dnf=1e18;
const int mod=1e9+7;
const double eps=1e-8;
const double pi=acos(-1.0);
const int maxn=100100;
const int maxm=100100;
const int up=100000;
const int hashp=13331;

namespace linear_seq
{
    #define SZ(x) ((int)(x).size())
    typedef vector<int> VI;
    typedef pair<int,int> PII;
    const int N=10010;
    ll res[N],base[N],c[N],md[N];
    vector<int> Md;
    const ll mod=1e9+7;

    ll powmod(ll a,ll b)
    {
        ll res=1;
        a%=mod;
        for(;b;b>>=1)
        {
            if(b&1)
                res=res*a%mod;
            a=a*a%mod;
        }
        return res;
    }

    void mul(ll *a,ll *b,int k)
    {
        for(int i=0;i<k+k;++i) c[i]=0;
        for(int i=0;i<k;++i)
            if(a[i])for(int j=0;j<k ;++j)
                    c[i+j]=(c[i+j]+a[i]*b[j])%mod;

        for (int i=k+k-1;i>=k;i--)
            if(c[i])for(int j=0;j<(int)Md.size();++ j)
                    c[i-k+Md[j]]=(c[i-k+Md[j]]-c[i]*md[Md[j]])%mod;

        for(int i=0;i<k;++i) a[i]=c[i];
    }

    int solve(ll n,VI a,VI b)
    {
        ll ans=0,pnt=0;
        int k=SZ(a);
        for(int i=0;i<k;++i) md[k-1-i]=-a[i];
        md[k]=1;Md.clear();
        for(int i=0;i<k;++i)
            if(md[i]!=0)Md.push_back(i);

        for(int i=0;i<k;++i) res[i]=base[i]=0;
        res[0]=1;

        while ((1ll<<pnt)<=n)
            pnt++;

        for (int p=pnt;p>=0;p--)
        {
            mul(res,res,k);
            if ((n>>p)&1)
            {
                for (int i=k-1;i>=0;i--) res[i+1]=res[i];
                res[0]=0;
                for(int j=0;j<(int)Md.size();++ j)
                    res[Md[j]]=(res[Md[j]]-res[k]*md[Md[j]])%mod;
            }
        }

        for(int i=0;i<k;i++) ans=(ans+res[i]*b[i])%mod;
        if (ans<0) ans+=mod;
        return ans;
    }

    VI BM(VI s)
    {
        VI C(1,1),B(1,1);
        int L=0,m=1,b=1;
        for(int n=0;n<(int)s.size();++n)
        {
            ll d=0;
            for(int i=0;i<L+1;++ i)
                d=(d+(ll)C[i]*s[n-i])%mod;
            if(d==0) ++m;
            else if(2*L<=n)
            {
                VI T=C;
                ll c=mod-d*powmod(b,mod-2)%mod;
                while (SZ(C)<SZ(B)+m)C.push_back(0);
                for(int i=0;i<(int)B.size();++i) C[i+m]=(C[i+m]+c*B[i])%mod;
                L=n+1-L; B=T; b=d; m=1;
            }
            else
            {
                ll c=mod-d*powmod(b,mod-2)%mod;
                while (SZ(C)<SZ(B)+m)C.push_back(0);
                for(int i=0;i<(int)B.size();++ i) C[i+m]=(C[i+m]+c*B[i])%mod;
                ++m;
            }
        }
        return C;
    }

    ll gao(VI a,ll n)
    {
        VI c=BM(a);
        c.erase(c.begin());
        for(int i=0;i<(int)c.size();++i) c[i]=(mod-c[i])%mod;
        return (ll)solve(n,c,VI(a.begin(),a.begin()+SZ(c)));
    }
};

ll d[maxn];
ll cnt[1100],dp[1100],sum[1100];
vector<int>vc;
int main(void)
{
    int n,x;
    scanf("%d%d",&n,&x);
    for(int i=1;i<=n;i++)
    {
        scanf("%lld",&d[i]);
        cnt[d[i]]++;
    }
    sum[0]=dp[0]=1;
    vc.pb(1);
    for(int i=1;i<=1000;i++)
    {
        for(int j=1;j<=min(i,100);j++)
            dp[i]=(dp[i]+dp[i-j]*cnt[j])%mod;
        sum[i]=(sum[i-1]+dp[i])%mod;
        vc.pb(sum[i]);
    }
    printf("%lld\n",linear_seq::gao(vc,x));
    return 0 ;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<string>
#include<queue>
#include<bitset>
#include<map>
#include<set>
#define ll long long
#define llu unsigned ll
#define pr make_pair
#define pb push_back
#define ui unsigned int
#define lc (cnt<<1)
#define rc (cnt<<1|1)
#define len(x)  (t[(x)].r-t[(x)].l+1)
#define tmid ((l+r)>>1)
#define forhead(x) for(int i=head[(x)];i;i=nt[i])
#define max(x,y) ((x)>(y)?(x):(y))
#define min(x,y) ((x)>(y)?(y):(x))
using namespace std;
const int inf=0x3f3f3f3f;
const ll lnf=0x3f3f3f3f3f3f3f3f;
const double dnf=1e18;
const int mod=1e9+7;
const double eps=1e-8;
const double pi=acos(-1.0);
const int maxn=100100;
const int maxm=100100;
const int up=100000;
const int hashp=13331;

namespace linear_seq
{
    #define SZ(x) ((int)(x).size())
    typedef vector<int> VI;
    typedef pair<int,int> PII;
    const int N=10010;
    ll res[N],base[N],c[N],md[N];
    vector<int> Md;
    const ll mod=998244353;

    ll powmod(ll a,ll b)
    {
        ll res=1;
        a%=mod;
        for(;b;b>>=1)
        {
            if(b&1)
                res=res*a%mod;
            a=a*a%mod;
        }
        return res;
    }

    void mul(ll *a,ll *b,int k)
    {
        for(int i=0;i<k+k;++i) c[i]=0;
        for(int i=0;i<k;++i)
            if(a[i])for(int j=0;j<k ;++j)
                    c[i+j]=(c[i+j]+a[i]*b[j])%mod;

        for (int i=k+k-1;i>=k;i--)
            if(c[i])for(int j=0;j<(int)Md.size();++ j)
                    c[i-k+Md[j]]=(c[i-k+Md[j]]-c[i]*md[Md[j]])%mod;

        for(int i=0;i<k;++i) a[i]=c[i];
    }

    int solve(ll n,VI a,VI b)
    {
        ll ans=0,pnt=0;
        int k=SZ(a);
        for(int i=0;i<k;++i) md[k-1-i]=-a[i];
        md[k]=1;Md.clear();
        for(int i=0;i<k;++i)
            if(md[i]!=0)Md.push_back(i);

        for(int i=0;i<k;++i) res[i]=base[i]=0;
        res[0]=1;

        while ((1ll<<pnt)<=n)
            pnt++;

        for (int p=pnt;p>=0;p--)
        {
            mul(res,res,k);
            if ((n>>p)&1)
            {
                for (int i=k-1;i>=0;i--) res[i+1]=res[i];
                res[0]=0;
                for(int j=0;j<(int)Md.size();++ j)
                    res[Md[j]]=(res[Md[j]]-res[k]*md[Md[j]])%mod;
            }
        }

        for(int i=0;i<k;i++) ans=(ans+res[i]*b[i])%mod;
        if (ans<0) ans+=mod;
        return ans;
    }

    VI BM(VI s)
    {
        VI C(1,1),B(1,1);
        int L=0,m=1,b=1;
        for(int n=0;n<(int)s.size();++n)
        {
            ll d=0;
            for(int i=0;i<L+1;++ i)
                d=(d+(ll)C[i]*s[n-i])%mod;
            if(d==0) ++m;
            else if(2*L<=n)
            {
                VI T=C;
                ll c=mod-d*powmod(b,mod-2)%mod;
                while (SZ(C)<SZ(B)+m)C.push_back(0);
                for(int i=0;i<(int)B.size();++i) C[i+m]=(C[i+m]+c*B[i])%mod;
                L=n+1-L; B=T; b=d; m=1;
            }
            else
            {
                ll c=mod-d*powmod(b,mod-2)%mod;
                while (SZ(C)<SZ(B)+m)C.push_back(0);
                for(int i=0;i<(int)B.size();++ i) C[i+m]=(C[i+m]+c*B[i])%mod;
                ++m;
            }
        }
        return C;
    }

    ll gao(VI a,ll n)
    {
        VI c=BM(a);
        c.erase(c.begin());
        for(int i=0;i<(int)c.size();++i) c[i]=(mod-c[i])%mod;
        return (ll)solve(n,c,VI(a.begin(),a.begin()+SZ(c)));
    }
};

ll d[maxn];
ll cnt[1100],dp[1100],sum[1100];
vector<int>vc;
int main(void)
{
    int n,x;
    scanf("%d%d",&n,&x);
    for(int i=1;i<=n;i++)
    {
        scanf("%lld",&d[i]);
        cnt[d[i]]++;
    }
    sum[0]=dp[0]=1;
    vc.pb(1);
    for(int i=1;i<=1000;i++)
    {
        for(int j=1;j<=min(i,100);j++)
            dp[i]=(dp[i]+dp[i-j]*cnt[j])%mod;
        sum[i]=(sum[i-1]+dp[i])%mod;
        vc.pb(sum[i]);
    }
    printf("%lld\n",linear_seq::gao(vc,n));
    return 0 ;
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define FAST ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define Loop(x, a, b) for(int x = a; x < b; ++x)
#define LoopR(x, a, b) for(int x = b - 1; x >= a; --x)
#define YN(flag) (flag? "YES\n": "NO\n")
#define all(x) x.begin(),x.end()
#define ll long long
#define Mod1 1000000007
#define Mod2 998244353
#define Bit(x,k) ((x >> k) & 1)
using namespace std;

int d[100010];
ll dp[101] = {};
ll matric[101][101] = {};
ll ansmat[101][101] = {};
int n, x;

void my_pow()
{
	Loop(i, 0, 101)
		ansmat[i][i] = 1;
	ll h[101][101];
	for (; x > 0; x >>= 1)
	{
		if (x & 1)
		{
			Loop(i, 0, 101)
				Loop(j, 0, 101)
					h[i][j] = ansmat[i][j];
			Loop(i, 0, 101)
			{
				Loop(j, 0, 101)
				{
					ansmat[i][j] = 0;
					Loop(k, 0, 101)
					{
						ansmat[i][j] += (matric[i][k] * h[k][j]) % Mod1;
						ansmat[i][j] %= Mod1;
					}
				}
			}
		}
		Loop(i, 0, 101)
			Loop(j, 0, 101)
				h[i][j] = matric[i][j];
		Loop(i, 0, 101)
		{
			Loop(j, 0, 101)
			{
				matric[i][j] = 0;
				Loop(k, 0, 101)
				{
					matric[i][j] += (h[i][k] * h[k][j]) % Mod1;
					matric[i][j] %= Mod1;
				}
			}
		}
	}
}

int main()
{
	FAST;
	cin >> n >> x;
	Loop(i, 0, n)
		cin >> d[i];
	dp[0] = 1;
	dp[100] = 1;
	Loop(i, 1, 100)
	{
		Loop(j, 0, n)
		{
			if (d[j] <= i)
				dp[i] += dp[i - d[j]];
		}
		dp[100] += dp[i];
		dp[i] %= Mod1;
	}
	d[100] %= Mod1;
	if (x < 100)
	{
		ll ans = 0;
		Loop(i, 0, x + 1)
			ans += dp[i];
		cout << (ans % Mod1);
		return 0;
	}
	Loop(i, 0, 99)
		matric[i + 1][i] = 1;
	Loop(i, 0, n)
	{
		matric[100 - d[i]][99]++;
		matric[100 - d[i]][100]++;
	}
	matric[100][100] = 1;
	x -= 99;
	my_pow();
	ll ans[101] = {};
	Loop(j, 0, 101)
	{
		Loop(k, 0, 101)
		{
			ans[j] += (dp[k] * ansmat[k][j]) % Mod1;
			ans[j] %= Mod1;
		}
	}
	cout << ans[100];
}


// ...
#pragma GCC optimize("Ofast", "unroll-loops")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = min((a), (b))
#define maxeq(a, b) (a) = max((a), (b))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

const ll R = 1e9 + 7;

ll n, x;
vll d, dist, dp;

inline void solve() {
	dist.assign(x + 1, 0);
	dist[0] = 1;
	for (ll i = 0; i <= x; i++) {
		for (ll j : d) {
			if (i - j >= 0) {
				dist[i] += dist[i - j];
				dist[i] %= R;
			}
		}
	}
	dp = dist;
	for (ll i = 1; i <= x; i++) {
		dp[i] += dp[i - 1];
		dp[i] %= R;
	}
	cout << dp[x] << endl;
}

inline void read() {
	cin >> n >> x;
	d.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> d[i];
	}
}

int main() {
	fast;
	read();
	solve();
	return 0;
}