/*input
74 33 1
4 5 5 2 1 2 2 2 2 2 3 2 3 4 2 2 1 4 4 4 5 4 1 2 4 5 4 2 4 2 5 1 2 1 5 3 5 4 1 4 1 1 2 4 4 5 1 4 2 4 2 3 3 2 5 5 4 3 5 1 3 5 5 4 4 4 2 5 4 2 2 3 4 4
2 5 4 4 2 1 4 4 4 5 4 1 2 1 5 2 4 3 4 1 4 1 2 5 1 4 5 4 2 1 2 5 3
*/

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

#define Fi              first
#define Se              second
#define S(n)            cin >> n
#define P(n)            cout << n
#define pb              push_back
#define pp              pop_back
#define pf              pop_front
#define nl              cout << "\n"
#define MIN(con)        (*min_element(ALL(con)))
#define MAX(con)        (*max_element(ALL(con)))
#define mem(n, a)       memset((n), (a), sizeof(n))
#define ALL(cont)       (cont).begin(),(cont).end()
#define NX(cont)        next_permutation(ALL(cont))
#define PX(cont)        prev_permutation(ALL(cont))
#define F(i, n, r)      for(int i = (n); i < (r); i ++)
#define prec(n)         cout << fixed << setprecision(n)
#define PI              3.14159265358979323846264338327951
#define FH(it,c)        for(__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++ it)
#define mp              make_pair
#define ff              first
#define ss              second
#define all(c)          c.begin(),c.end()
#define fill(a,v)       memset(a,v,sizeof a)
#define rep(i,a,b)      for(ll i=a;i<b;i++)
#define rrep(i,a,b)     for(ll i=a;i>=b;i--)
#define srep(i,s)       for(ll i=0;s[i]!='\0';i++)
#define nn              cout<<"\n"
#define sp              cout<<" "
#define mod             10000009    //7
#define ifalse          ios_base::sync_with_stdio(false),cin.tie(NULL)

using ll = long long;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<string> vst;
typedef pair<ll,ll> pll;
typedef pair<char,ll> pcl;
typedef pair<string,ll> psl;
typedef set<ll> sll;
typedef set<char> sc;
typedef set<string> sst;
typedef map<char,ll> mcl;
typedef map<ll,ll> mll;
typedef map<string,ll> msl;

using ld = long double;

template < typename T > inline T LCM(T a, T b)            { return (a * b) / GCD(a, b); }
template < typename T > inline T GCD(T a, T b)            { ll t; while(a) { t = a; a = b % a; b = t; } return b; }
template < typename T > inline string toString(T a)       {return to_string(a); }  // Convert int to string
template < typename T > inline void toInt(string s, T &x) { stringstream str(s); str >> x;}  // Convert string to int

inline ll add(ll x, ll y) { x += y; if(x >= mod) x -= mod; return x; }
inline ll sub(ll x, ll y) { x -= y; if(x < 0) x += mod; return x; }
inline ll mul(ll x, ll y) { return ((x % mod) * (y % mod)) % mod; }

inline ll powr(ll a, ll b){
    ll x = 1LL;
    while(b) {
        if(b & 1) x = mul(x, a);
        a = mul(a, a);
        b >>= 1;
    }
    return x;
}

inline ll inv(ll a) { return powr(a, mod - 2);}

const int inv2 = (mod + 1) >> 1;
const ll INF =  999999999999999999;

bool check(ll n)
{
    if(n == 1) return 0;
    if(n == 2 or n == 3) return 1;
    if(n % 2 == 0 or n % 3 == 0) return 0;

    for(ll i = 5; i * i <= n; i += 6) if(n % i == 0 or n % (i + 2) == 0) return 0;
    return 1;
}

/****************************************************START********************************************************************/

const int N = 3 * 1e5 + 5;

int a[N], b[N];
bool mark[N];

int main()
{
    ifalse;
    int n, m, p;
    ll ans = 0;
    ll o = 5;

    map < int, int > mp;

    cin >> n >> m >> p;

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

    set < int > s;
    for(int i = 0; i < m; i ++) {
        cin >> b[i];
        s.insert(b[i]);
    }

    for(auto x: s) {
        mp[x] = o;
        o *= o;
        o %= 1000000007;
    }
    for(int i = 0; i < m; i ++) {
        ans += mp[b[i]];
    }
    if(m > n) {
        return cout << "0", nl, 0;
    }

    o = -1e15;
    vector < int > v3;

    for(int i = 0; i < p; i ++) {
        if(mark[i]) {
            break;
        }
        ll sum = 0;
        int d  = 0;
        for(int j = i; j <= i + (m - 1) * p; j += p) {
            if(mp[a[j]] == 0) {
                mp[a[j]] = o;
                o ++;
            }
            sum += mp[a[j]];
            mark[j] = 1;
        }
        if(sum == ans) {
            v3.pb(i + 1);
        }
        int f = i + (m - 1) * p + p;
        int l = i;
        for(int j = f; j < n; j += p) {
            sum -= mp[a[l]];
            if(mp[a[j]] == 0) {
                mp[a[j]] = o;
                o ++;
            }
            sum += mp[a[j]];
            if(sum == ans) {
                v3.pb(l + p + 1);
            }
            l += p;
            mark[j] = 1;
        }
    }
    sort(all(v3));
    cout << v3.size(), nl;
    for(auto x: v3) {
        cout << x, sp;
    }
    nl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define LL long long int
#define ULL unsigned long long int
#define sf(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define fr first
#define sc second
#define pii pair<int,int>
#define pll pair<LL,LL>
#define vi vector<int>
#define vll vector<LL>
#define vpii  vector<pii>
#define rep1(a,b) for(int a=1;a<=b;a++)
#define rep2(a,b) for(int a=0;a<b;a++)
#define CLR(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define mp make_pair
#define mod 1717171769
#define  LSOne(S) (S&(-S))
#define all(a) a.begin(),a.end()
#define Prime 31
using namespace std;
#define maxn 100010
int ar1[200010];
int ar2[200010];
int cmp[200010];
int n,m,p;
int ncmp=1;
vector<vi > have;
bool dfs(int pos,int i)
{
    if(pos>=n)
            return i>=m;
    if(dfs(pos+p,i+1))
    {
        cmp[pos]=ncmp;
        return true;
    }
    else cmp[pos]=-1;
    return true;
}
int global[200005];
int pre[200005];
int res[200005];
int main()
{
    #ifdef shakil
    freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    #endif // ONLINE_JUDGE
    cin>>n>>m>>p;
   for(int i=0;i<n;i++) scanf("%d",&ar1[i]);
    set<int>set1;
    for(int i=0;i<m;i++) {
            scanf("%d",&ar2[i]);
            set1.insert(ar2[i]);
    }
    map<int,int> map1;
    int ele=1;
    for(auto a:set1) map1[a]=ele++;
    for(int i=0;i<m;i++) ar2[i]=map1[ar2[i]];
    for(int i=0;i<m;i++) global[ar2[i]]++;
    for(int i=0;i<n;i++) ar1[i]=map1[ar1[i]];
    ncmp=1;
    for(int i=0;i<n;i++)
    if(cmp[i]==0)
    {
        if(dfs(i,0)) ncmp++;
    }
    have.assign(ncmp+10,vi(ele,0));
    memset(pre,-1,sizeof(pre));
    vi ans;
    for(int i=0;i<n;i++)
    {
        if(1ll*i + 1ll*(m-1)*1ll*p    >= 1ll*n) break;
        if(pre[cmp[i]]==-1)
            for(int j=0;j<m;j++)
        {
            int k=i+ j*p;
            have[cmp[k]][ar1[k]]++;
            if(have[cmp[k]][ar1[k]] <= global[ar1[k]])
                res[cmp[k]]++;
        }
        else
        {
            int k=i+ (m-1)*p;
            have[cmp[k]][ar1[k]]++;
            if(have[cmp[k]][ar1[k]] <= global[ar1[k]])
                res[cmp[k]]++;
            k=pre[cmp[i]];
            have[cmp[k]][ar1[k]]--;
            if(have[cmp[k]][ar1[k]] < global[ar1[k]])
                res[cmp[k]]--;
        }
        pre[cmp[i]]=i;
        if(res[cmp[i]]==m) ans.pb(i);
    }
    cout<<ans.size()<<endl;
    for(int i=0;i<ans.size();i++){
        if(i) printf(" ");
        printf("%d",ans[i]+1);
    }
    if(ans.size()) cout<<endl;

   // for(int i=0;i<n;i++) cout<<ar1[i]<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define LL long long int
#define ULL unsigned long long int
#define sf(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define fr first
#define sc second
#define pii pair<int,int>
#define pll pair<LL,LL>
#define vi vector<int>
#define vll vector<LL>
#define vpii  vector<pii>
#define rep1(a,b) for(int a=1;a<=b;a++)
#define rep2(a,b) for(int a=0;a<b;a++)
#define CLR(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define mp make_pair
#define mod 1717171769
#define  LSOne(S) (S&(-S))
#define all(a) a.begin(),a.end()
#define Prime 31
using namespace std;
#define maxn 100010
int ar1[200010];
int ar2[200010];
int cmp[200010];
int n,m,p;
int ncmp=1;
map<int,int> have[200100];
bool dfs(int pos,int i)
{
    if(pos>=n)
            return i>=m;
    if(dfs(pos+p,i+1))
    {
        cmp[pos]=ncmp;
        return true;
    }
    else cmp[pos]=-1;
    return true;
}
int global[200005];
int pre[200005];
int res[200005];
int main()
{
    #ifdef shakil
    freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    #endif // ONLINE_JUDGE
    cin>>n>>m>>p;
   for(int i=0;i<n;i++) scanf("%d",&ar1[i]);
    set<int>set1;
    for(int i=0;i<m;i++) {
            scanf("%d",&ar2[i]);
            set1.insert(ar2[i]);
    }
    map<int,int> map1;
    int ele=1;
    for(auto a:set1) map1[a]=ele++;
    for(int i=0;i<m;i++) ar2[i]=map1[ar2[i]];
    for(int i=0;i<m;i++) global[ar2[i]]++;
    for(int i=0;i<n;i++) ar1[i]=map1[ar1[i]];
    ncmp=1;
    for(int i=0;i<n;i++)
    if(cmp[i]==0)
    {
        if(dfs(i,0)) ncmp++;
    }
    memset(pre,-1,sizeof(pre));
    vi ans;
    for(int i=0;i<n;i++)
    {
        if(1ll*i + 1ll*(m-1)*1ll*p    >= 1ll*n) break;
        if(pre[cmp[i]]==-1)
            for(int j=0;j<m;j++)
        {
            int k=i+ j*p;
            have[cmp[k]][ar1[k]]++;
            if(have[cmp[k]][ar1[k]] <= global[ar1[k]])
                res[cmp[k]]++;
        }
        else
        {
            int k=i+ (m-1)*p;
            have[cmp[k]][ar1[k]]++;
            if(have[cmp[k]][ar1[k]] <= global[ar1[k]])
                res[cmp[k]]++;
            k=pre[cmp[i]];
            have[cmp[k]][ar1[k]]--;
            if(have[cmp[k]][ar1[k]] < global[ar1[k]])
                res[cmp[k]]--;
        }
        pre[cmp[i]]=i;
        if(res[cmp[i]]==m) ans.pb(i);
    }
    cout<<ans.size()<<endl;
    for(int i=0;i<ans.size();i++){
        if(i) printf(" ");
        printf("%d",ans[i]+1);
    }
    if(ans.size()) cout<<endl;

   // for(int i=0;i<n;i++) cout<<ar1[i]<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define LL long long int
#define ULL unsigned long long int
#define sf(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define fr first
#define sc second
#define pii pair<int,int>
#define pll pair<LL,LL>
#define vi vector<int>
#define vll vector<LL>
#define vpii  vector<pii>
#define rep1(a,b) for(int a=1;a<=b;a++)
#define rep2(a,b) for(int a=0;a<b;a++)
#define CLR(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define mp make_pair
#define mod 1717171769
#define  LSOne(S) (S&(-S))
#define all(a) a.begin(),a.end()
#define Prime 31
using namespace std;
#define maxn 100010
int ar1[200010];
int ar2[200010];
int cmp[200010];
int n,m,p;
int ncmp=1;
vector<vi > have;
bool dfs(int pos,int i)
{
    if(pos>=n)
            return i>=m;
    if(dfs(pos+p,i+1))
    {
        cmp[pos]=ncmp;
        return true;
    }
    else cmp[pos]=-1;
    return true;
}
int global[200005];
int pre[200005];
int res[200005];
int main()
{
    #ifdef shakil
    freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    #endif // ONLINE_JUDGE
    cin>>n>>m>>p;
   // for(int i=0;i<n;i++) scanf("%d",&ar1[i]);
    set<int>set1;
    for(int i=0;i<m;i++) {
           // scanf("%d",&ar2[i]);
            set1.insert(ar2[i]);
    }
    map<int,int> map1;
    int ele=1;
    for(auto a:set1) map1[a]=ele++;
    for(int i=0;i<m;i++) ar2[i]=map1[ar2[i]];
    for(int i=0;i<m;i++) global[ar2[i]]++;
    for(int i=0;i<n;i++) ar1[i]=map1[ar1[i]];
    ncmp=1;
    for(int i=0;i<n;i++)
    if(cmp[i]==0)
    {
        if(dfs(i,0)) ncmp++;
    }
    have.assign(ncmp+10,vi(ele,0));
    memset(pre,-1,sizeof(pre));
    vi ans;
    for(int i=0;i<n;i++)
    {
        if(1ll*i + 1ll*(m-1)*1ll*p    >= 1ll*n) continue;
        if(pre[cmp[i]]==-1)
            for(int j=0;j<m;j++)
        {
            int k=i+ j*p;
            have[cmp[k]][ar1[k]]++;
            if(have[cmp[k]][ar1[k]] <= global[ar1[k]])
                res[cmp[k]]++;
        }
        else
        {
            int k=i+ (m-1)*p;
            have[cmp[k]][ar1[k]]++;
            if(have[cmp[k]][ar1[k]] <= global[ar1[k]])
                res[cmp[k]]++;
            k=pre[cmp[i]];
            have[cmp[k]][ar1[k]]--;
            if(have[cmp[k]][ar1[k]] < global[ar1[k]])
                res[cmp[k]]--;
        }
        pre[cmp[i]]=i;
        if(res[cmp[i]]==m) ans.pb(i);
    }
    cout<<ans.size()<<endl;
    for(int i=0;i<ans.size();i++){
        if(i) printf(" ");
        printf("%d",ans[i]+1);
    }
    if(ans.size()) cout<<endl;

   // for(int i=0;i<n;i++) cout<<ar1[i]<<endl;
    return 0;
}


#include <bits/stdc++.h>
#define owo(i,a, b) for(int i=(a);i<(b); ++i)
#define uwu(i,a, b) for(int i=(a)-1; i>=(b); --i)
#define senpai push_back
#define ttgl pair<int, int>
#define ayaya cout<<"ayaya~"<<endl

using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
gpu_hash_map<int, int> mp;*/
using ll = long long;
using ld = long double;
const ll MOD = 1000000007;
const ll root = 62;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
ll binpow(ll a,ll b){ll res=1;while(b){if(b&1)res=(res*a)%MOD;a=(a*a)%MOD;b>>=1;}return res;}
ll modInv(ll a){return binpow(a, MOD-2);}
const double PI = acos(-1);
const double eps = -1e6;
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll NINFLL = 0xc0c0c0c0c0c0c0c0;
const int mxN = 100001;
struct M {
    const static int n = 102;
    ll m[n][n];
    M() { memset(m, 0, sizeof m); }
    M operator*(const M& m2) {
        M res;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                for (int a = 0; a < n; a++) {
                    res.m[i][j] += m[i][a] * m2.m[a][j];
                    if (res.m[i][j] >= MOD) res.m[i][j] %= MOD;
                }
            }
        }
        return res;
    }
    static M pow(M &m, int e) {
        M res = I();
        while (e) {
            if (e & 1) res = res * m;
            m = m * m;
            e >>= 1;
        }
        return res;
    }
    static M I() {
        M m;
        for (int i = 0; i < n; i++) m.m[i][i] = 1;
        return m;
    }
}res;
int n, x;
int arr[mxN];
int num[101];
ll f[101];
ll sum;
ll ans = 0;
ll gt(int pos) {
    if(get==0)return sum;
    else return f[100-pos+1];
}
int main() {
    //freopen("file.in", "r", stdin);
    //freopen("file.out", "w", stdout);
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    cin.tie(0)->sync_with_stdio(0);
    cin>>n>>x;
    owo(i, 0, n) {
        cin>>arr[i];
        num[arr[i]]++;
    }
    f[0] = 1;
    sum = 1;
    owo(i, 1, 101) {
        owo(j, 0, i) {
            f[i] += f[j]*num[i-j];
        }
        sum+=f[i];
    }

    res.m[0][0] = 1;
    owo(i, 1, 101) {
        res.m[0][i] = num[i];
    }
    owo(i, 1, 101) {
        res.m[1][i] = num[i];
    }
    owo(j, 2, 101) {
        res.m[j][j-1] = 1;
    }
    if(x<100) {
        owo(i, 0, x+1) {
            ans=(ans + f[i])%MOD;
        }
        cout<<ans<<"\n";
    }else {
        res.pow(res, 100-x);
        owo(i, 0, 101){
            ans = (ans + res.m[0][i]*gt(i))%MOD;
        }
        cout<<ans<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;

ll MOD = 1e9 + 7;
ll K = 2;

struct Matrix
{
    vector<vector<ll>> mat;
    int n_rows, n_cols;

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

    static Matrix identity_matrix(int n)
    {
        vector<vector<ll>>values(n, vector<ll>(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<ll>>result(n_rows, vector<ll>(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;
        return Matrix(result);
    }

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

Matrix fast_exponentiation(Matrix m, ll 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;
}

ll n, x, ans, frq[101];

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> x;
    for(int i = 0;i < n;++i)
    {
        int num;
        cin >> num;
        ++frq[num];
    }
    K = 101;
    vector<vector<ll>>a(K, vector<ll>(1, 0)), t(K, vector<ll>(K, 0));
    a[0][0] = 1;
    for(int i = 1;i < 100;++i)
        for(int j = 1;j <= i;++j)
            (a[i][0] += (a[i - j][0] * frq[j]) % MOD) %= MOD;
    if(x < 100)
    {
        for(int i = 0;i <= x;++i)
            (ans += a[i][0]) %= MOD;
        return cout << ans, 0;
    }
    for(int i = 0;i < 100;++i)
        (a[100][0] += a[i][0]) %= MOD;
    for(int i = 0;i < 99;++i)
        t[i][i + 1] = 1;
    for(int i = 1;i < 100;++i)
        t[99][i] = t[100][i] = frq[100 - i];
    t[100][100] = 1;
    Matrix A(a), T(t);
    T = fast_exponentiation(T, x - 99);
    A = T * A;
    ans = A.mat[100][0];
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;

ll MOD = 1e9 + 7;
ll K = 2;

struct Matrix
{
    vector<vector<ll>> mat;
    int n_rows, n_cols;

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

    static Matrix identity_matrix(int n)
    {
        vector<vector<ll>>values(n, vector<ll>(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<ll>>result(n_rows, vector<ll>(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;
        return Matrix(result);
    }

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

Matrix fast_exponentiation(Matrix m, ll 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;
}

ll n, x, ans, frq[101];

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> x;
    for(int i = 0;i < n;++i)
    {
        int num;
        cin >> num;
        ++frq[num];
    }
    K = 102;
    vector<vector<ll>>a(K, vector<ll>(1, 0)), t(K, vector<ll>(K, 0));
    a[0][0] = 1;
    for(int i = 1;i <= 100;++i)
        for(int j = 1;j <= i;++j)
            (a[i][0] += (a[i - j][0] * frq[j]) % MOD) % MOD;
    for(int i = 0;i < 100;++i)
        t[i][i + 1] = 1;
    for(int i = 0;i <= 100;++i)
        t[100][100 - i] = frq[i];
    for(int i = 0;i < K;++i)
        t[101][i] = 1;
    if(x <= 100)
        for(int i = 0;i <= x;++i)
            (ans += a[i][0]) %= MOD;
    else
    {
        Matrix A(a), T(t);
        T = fast_exponentiation(T, x - 99);
        A = T * A;
        ans = A.mat[K - 1][0];
    }
    cout << ans;
    return 0;

}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;

ll MOD = 1e9 + 7;
ll K = 2;

struct Matrix
{
    vector<vector<ll>> mat;
    int n_rows, n_cols;

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

    static Matrix identity_matrix(int n)
    {
        vector<vector<ll>>values(n, vector<ll>(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<ll>>result(n_rows, vector<ll>(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] += (mat[i][k] * other.mat[k][j]) % MOD) %= MOD;
        return Matrix(result);
    }

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

Matrix fast_exponentiation(Matrix m, ll 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;
}

ll n, x, ans, frq[101];

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> x;
    for(int i = 0;i < n;++i)
    {
        int num;
        cin >> num;
        ++frq[num];
    }
    K = 102;
    vector<vector<ll>>a(K, vector<ll>(1, 0)), t(K, vector<ll>(K, 0));
    a[0][0] = 1;
    for(int i = 1;i <= 100;++i)
        for(int j = 1;j <= i;++j)
            (a[i][0] += (a[i - j][0] * frq[j]) % MOD) %= MOD;
    if(x <= 100)
    {
        for(int i = 0;i <= x;++i)
            (ans += a[i][0]) %= MOD;
        return cout << ans, 0;
    }
    for(int i = 0;i < 100;++i)
        (a[101][0] += a[i][0]) %= MOD;
    for(int i = 0;i < 102;++i)
    {
        if(i >= 100)
            for(int j = 99;j >= 0;--j)
                t[i][j] = frq[100 - j];
        else
            t[i][i + 1] = 1;
    }
    t[101][101] = 1;
    Matrix A(a), T(t);
    T = fast_exponentiation(T, x - 99);
    A = T * A;
    ans = A.mat[101][0];
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;

ll MOD = 1e9 + 7;
ll K = 2;

struct Matrix
{
    vector<vector<ll>> mat;
    int n_rows, n_cols;

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

    static Matrix identity_matrix(int n)
    {
        vector<vector<ll>>values(n, vector<ll>(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<ll>>result(n_rows, vector<ll>(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;
        return Matrix(result);
    }

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

Matrix fast_exponentiation(Matrix m, ll 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;
}

ll n, x, ans, frq[101];

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> x;
    for(int i = 0;i < n;++i)
    {
        int num;
        cin >> num;
        ++frq[num];
    }
    K = 102;
    vector<vector<ll>>a(K, vector<ll>(1, 0)), t(K, vector<ll>(K, 0));
    a[0][0] = 1;
    for(int i = 1;i <= 100;++i)
        for(int j = 1;j <= i;++j)
            (a[i][0] += (a[i - j][0] * frq[j]) % MOD) %= MOD;
    if(x <= 100)
    {
        for(int i = 0;i <= x;++i)
            (ans += a[i][0]) %= MOD;
        return cout << ans, 0;
    }
    for(int i = 0;i < 100;++i)
    {
        t[i][i + 1] = 1;
        t[100][i] = frq[100 - i];
        (a[101][0] += a[i][0]) %= MOD;
    }
    t[101][100] = 1;
    t[101][101] = 1;
    Matrix A(a), T(t);
    T = fast_exponentiation(T, x - 99);
    A = T * A;
    ans = A.mat[101][0];
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;

ll MOD = 1e9 + 7;
ll K = 2;

struct Matrix
{
    vector<vector<ll>> mat;
    int n_rows, n_cols;

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

    static Matrix identity_matrix(int n)
    {
        vector<vector<ll>>values(n, vector<ll>(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<ll>>result(n_rows, vector<ll>(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;
        return Matrix(result);
    }

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

Matrix fast_exponentiation(Matrix m, ll 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;
}

ll n, x, ans, frq[101];

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> x;
    for(int i = 0;i < n;++i)
    {
        int num;
        cin >> num;
        ++frq[num];
    }
    K = 102;
    vector<vector<ll>>a(K, vector<ll>(1, 0)), t(K, vector<ll>(K, 0));
    a[0][0] = 1;
    for(int i = 1;i <= 100;++i)
        for(int j = 1;j <= 100;++j)
            if(i - j >= 0)
                (a[i][0] += (a[i - j][0] * frq[j]) % MOD) %= MOD;
    if(x <= 100)
    {
        for(int i = 0;i <= x;++i)
            (ans += a[i][0]) %= MOD;
        return cout << ans, 0;
    }
    for(int i = 0;i < 100;++i)
    {
        t[i][i + 1] = 1;
        t[100][100 - i] = frq[i];
    }
    for(int i = 0;i <= 101;++i)
        t[101][i] = 1;
    Matrix A(a), T(t);
    T = fast_exponentiation(T, x - 99);
    A = T * A;
    ans = A.mat[101][0];
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;

ll MOD = 1e9 + 7;
ll K = 2;

struct Matrix
{
    vector<vector<ll>> mat;
    int n_rows, n_cols;

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

    static Matrix identity_matrix(int n)
    {
        vector<vector<ll>>values(n, vector<ll>(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<ll>>result(n_rows, vector<ll>(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;
        return Matrix(result);
    }

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

Matrix fast_exponentiation(Matrix m, ll 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;
}

ll n, x, ans, frq[101];

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> x;
    for(int i = 0;i < n;++i)
    {
        int num;
        cin >> num;
        ++frq[num];
    }
    K = 102;
    vector<vector<ll>>a(K, vector<ll>(1, 0)), t(K, vector<ll>(K, 0));
    a[0][0] = 1;
    for(int i = 1;i <= 100;++i)
        for(int j = 1;j <= 100;++j)
            if(i - j >= 0)
                (a[i][0] += (a[i - j][0] * frq[j]) % MOD) %= MOD;
    for(int i = 0;i < 100;++i)
        t[i][i + 1] = 1;
    for(int i = 0;i <= 100;++i)
        t[100][i] = frq[i];
    for(int i = 0;i <= 100;++i)
        t[K - 1][i] = 1;
    if(x <= 100)
        for(int i = 0;i <= x;++i)
            (ans += a[i][0]) %= MOD;
    else
    {
        Matrix A(a), T(t);
        T = fast_exponentiation(T, x - 99);
        A = T * A;
        ans = A.mat[K - 1][0];
    }
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;

ll MOD = 1e9 + 7;
ll K = 2;

struct Matrix
{
    vector<vector<ll>> mat;
    int n_rows, n_cols;

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

    static Matrix identity_matrix(int n)
    {
        vector<vector<ll>>values(n, vector<ll>(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<ll>>result(n_rows, vector<ll>(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] += (mat[i][k] * other.mat[k][j]) % MOD) %= MOD;
        return Matrix(result);
    }

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

Matrix fast_exponentiation(Matrix m, ll 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;
}

ll n, x, ans, frq[101];

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> x;
    for(int i = 0;i < n;++i)
    {
        int num;
        cin >> num;
        ++frq[num];
    }
    K = 101;
    vector<vector<ll>>a(K, vector<ll>(1, 0)), t(K, vector<ll>(K, 0));
    a[0][0] = 1;
    for(int i = 1;i < 100;++i)
        for(int j = 1;j <= i;++j)
            (a[i][0] += (a[i - j][0] * frq[j]) % MOD) %= MOD;
    if(x < 100)
    {
        for(int i = 0;i <= x;++i)
            (ans += a[i][0]) %= MOD;
        return cout << ans, 0;
    }
    for(int i = 0;i < 100;++i)
        (a[100][0] += a[i][0]) %= MOD;
    for(int i = 0;i < 99;++i)
        t[i][i + 1] = 1;
    for(int i = 1;i < 100;++i)
        t[99][i] = t[100][i] = frq[100 - i];
    t[100][100] = 1;
    Matrix A(a), T(t);
    T = fast_exponentiation(T, x - 99);
    A = T * A;
    ans = A.mat[100][0];
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;

ll MOD = 1e9 + 7;
ll K = 2;

struct Matrix
{
    vector<vector<ll>> mat;
    int n_rows, n_cols;

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

    static Matrix identity_matrix(int n)
    {
        vector<vector<ll>>values(n, vector<ll>(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<ll>>result(n_rows, vector<ll>(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;
        return Matrix(result);
    }

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

Matrix fast_exponentiation(Matrix m, ll 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;
}

ll n, x, ans, frq[101];

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> x;
    for(int i = 0;i < n;++i)
    {
        int num;
        cin >> num;
        ++frq[num];
    }
    K = 102;
    vector<vector<ll>>a(K, vector<ll>(1, 0)), t(K, vector<ll>(K, 0));
    a[0][0] = 1;
    for(int i = 1;i <= 100;++i)
        for(int j = 1;j <= 100;++j)
            if(i - j >= 0)
                (a[i][0] += (a[i - j][0] * frq[j]) % MOD) % MOD;
    for(int i = 0;i < 100;++i)
        t[i][i + 1] = 1;
    for(int i = 0;i <= 100;++i)
        t[100][i] = frq[i];
    for(int i = 0;i <= 100;++i)
        t[K - 1][i] = 1;
    if(x <= 100)
        for(int i = 0;i <= x;++i)
            (ans += a[i][0]) %= MOD;
    else
    {
        Matrix A(a), T(t);
        T = fast_exponentiation(T, x - 99);
        A = T * A;
        ans = A.mat[K - 1][0];
    }
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;

ll MOD = 1e9 + 7;
ll K = 2;

struct Matrix
{
    vector<vector<ll>> mat;
    int n_rows, n_cols;

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

    static Matrix identity_matrix(int n)
    {
        vector<vector<ll>>values(n, vector<ll>(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<ll>>result(n_rows, vector<ll>(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;
        return Matrix(result);
    }

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

Matrix fast_exponentiation(Matrix m, ll 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;
}

ll n, x, ans, frq[101];

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> x;
    for(int i = 0;i < n;++i)
    {
        int num;
        cin >> num;
        ++frq[num];
    }
    K = 102;
    vector<vector<ll>>a(K, vector<ll>(1, 0)), t(K, vector<ll>(K, 0));
    a[0][0] = 1;
    for(int i = 1;i <= 100;++i)
        for(int j = 1;j <= i;++j)
            (a[i][0] += (a[i - j][0] * frq[j]) % MOD) %= MOD;
    for(int i = 0;i < 100;++i)
        (a[101][0] += a[i][0]) %= MOD;
    for(int i = 0;i < 100;++i)
        t[i][i + 1] = 1;
    for(int i = 0;i <= 100;++i)
        t[100][100 - i] = frq[i];
    t[K - 1][K - 1] = t[K - 1][K - 2] = 1;
    if(x <= 100)
        for(int i = 0;i <= x;++i)
            (ans += a[i][0]) %= MOD;
    else
    {
        Matrix A(a), T(t);
        T = fast_exponentiation(T, x - 99);
        A = T * A;
        ans = A.mat[K - 1][0];
    }
    cout << ans;
    return 0;

}


#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;

ll MOD = 1e9 + 7;
ll K = 2;

struct Matrix
{
    vector<vector<ll>> mat;
    int n_rows, n_cols;

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

    static Matrix identity_matrix(int n)
    {
        vector<vector<ll>>values(n, vector<ll>(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<ll>>result(n_rows, vector<ll>(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] += (mat[i][k] * other.mat[k][j]) % MOD) %= MOD;
        return Matrix(result);
    }

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

Matrix fast_exponentiation(Matrix m, ll 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;
}

ll n, x, ans, frq[101];

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> x;
    for(int i = 0;i < n;++i)
    {
        int num;
        cin >> num;
        ++frq[num];
    }
    K = 101;
    vector<vector<ll>>a(K, vector<ll>(1, 0)), t(K, vector<ll>(K, 0));
    a[0][0] = 1;
    for(int i = 1;i < 100;++i)
        for(int j = 1;j <= i;++j)
            (a[i][0] += (a[i - j][0] * frq[j]) % MOD) %= MOD;
    if(x < 100)
    {
        for(int i = 0;i <= x;++i)
            (ans += a[i][0]) %= MOD;
        return cout << ans, 0;
    }
    for(int i = 0;i < 100;++i)
        (a[100][0] += a[i][0]) %= MOD;
    for(int i = 0;i < 101;++i)
    {
        if(i >= 99)
            for(int j = 99;j >= 0;--j)
                t[i][j] = frq[100 - j];
        else
            t[i][i + 1] = 1;
    }
    t[100][100] = 1;
    Matrix A(a), T(t);
    T = fast_exponentiation(T, x - 99);
    A = T * A;
    ans = A.mat[100][0];
    cout << ans;
    return 0;
}


#include <bits/stdc++.h>

#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define mp make_pair
#define input freopen("input.txt","r",stdin);
#define output freopen("output.txt","w",stdout);
#define fast_io ios::sync_with_stdio(NULL), cin.tie(NULL), cout.tie(NULL);
#define fix cout << fixed << setprecision(15);
//#define left left228
//#define right right228
//#define next next228
//#define rank rank228
//#define prev prev228
#define y1 y1228
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int> ;
using pll = pair<ll, ll>;
using pci = pair<char, int>;
using vi = vector<int> ;
using vll = vector<ll> ;
using vpii = vector<pii> ;
const ll infll = 1e18 + 3;
const int maxn = 1e6 + 77;
const int nmax = 1e6 + 77;
const ll basell = 1e18 + 3;
const int mod = 1e9 + 7;
const ld eps = 1e-7;
const int inf = 1009000999;
const int nv = 100505;
const int baseint = 1000200013;
const ld PI = acos(-1.0);
inline bool EQ(ld a, ld b) { return fabs(a-b) < 1e-9; }
//typedef pair<int, int> pt;
//#define x first
//#define y second
//ifstream cin("input.txt");
//ofstream cout("output.txt");
//cout << fixed << setprecision(15);
/*
sort(a, a + n, [&](pair<pt, int> a, pair<pt, int> b){if (a.x.x != b.x.x)
        return a.x.x < b.x.x; return a.x.y > b.x.y;});
for(int c : s)
for (int &i : a) cin >> i;
for(int c = 'a'; c <= 'z'; ++c)
vector<vector<ll>> dp(n, vector<ll>(n+2));
__int128;
char 0 = int 48;
char c = cin;
int h = (int)c - 48;
*/

/*char memory[(int)1e8];

char memorypos;

inline void * operator new(size_t n){
    char * ret = memory + memorypos;
    memorypos += n;
    return (void *)ret;
}

inline void operator delete(void *){}
*/

typedef vector<vector<int>> matrix;

matrix mul(matrix a, matrix b) {
    matrix c(a.size(), vector<int>(b[0].size(), 0));
    for(int i = 0; i < a.size(); i++)
        for(int j = 0; j < b[0].size(); j++)
            for(int k = 0; k < b.size(); k++)
                c[i][j] = (c[i][j] + ll(a[i][k]) * b[k][j]) % mod;
    return c;
}

matrix pw(matrix a, int b) {
    assert(b);
    if(b == 1) return a;
    if(b & 1) return mul(pw(a, b - 1), a);
    a = pw(a, b / 2);
    return mul(a, a);
}

int k[101];

int dp[101];

int inline solve() {
    //input;output;
    //fix;
    fast_io;
    int n, x;
    cin >> n >> x;
    for (int i = 0; i < n; ++i) {
        int d;
        cin >> d;
        k[d - 1]++;
    }
    matrix ma(101, vector<int>(101, 0));
    for (int i = 0; i < 99; ++i) {
        ma[i][i + 1] = 1;
    }
    for (int i = 0; i < 100; ++i) {
        ma[99][99 - i] = ma[100][99 - i] = k[i];
    }
    ma[100][100] = 1;
    dp[0] = 1;
    for (int i = 1; i < 100; ++i) {
        for (int j = 0; j < i; ++j) {
            dp[i] = (dp[i] + ll(dp[i - j - 1] * k[j])) % mod;
        }
    }
    if(x < 100){
        int ans = 0;
        for (int i = 0; i <= x; ++i) {
            ans += dp[i];
            ans %= mod;
        }
        cout << ans;
        return 0;
    }
    matrix a(101, vector<int>(1, 0));
    for (int i = 0; i < 100; ++i) {
        a[i][0] = dp[i];
        a[100][0] = (a[100][0] + dp[i])%mod;
    }
    ma = pw(ma, x - 99);
    cout << mul(ma, a)[100][0];
    return 0;
}
int32_t main() {
    //freopen("mushrooms.in", "r", stdin);
    //freopen("mushrooms.out", "w", stdout);
    solve();
    return 0;
}
/*
4
4 3 5
4 5 2
3 2 1
5 4 1

 * */


#include <bits/stdc++.h>

#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define mp make_pair
#define input freopen("input.txt","r",stdin);
#define output freopen("output.txt","w",stdout);
#define fast_io ios::sync_with_stdio(NULL), cin.tie(NULL), cout.tie(NULL);
#define fix cout << fixed << setprecision(15);
//#define left left228
//#define right right228
//#define next next228
//#define rank rank228
//#define prev prev228
#define y1 y1228
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int> ;
using pll = pair<ll, ll>;
using pci = pair<char, int>;
using vi = vector<int> ;
using vll = vector<ll> ;
using vpii = vector<pii> ;
const ll infll = 1e18 + 3;
const int maxn = 1e6 + 77;
const int nmax = 1e6 + 77;
const ll basell = 1e18 + 3;
const int mod = 1e9 + 7;
const ld eps = 1e-7;
const int inf = 1009000999;
const int nv = 100505;
const int baseint = 1000200013;
const ld PI = acos(-1.0);
inline bool EQ(ld a, ld b) { return fabs(a-b) < 1e-9; }
//typedef pair<int, int> pt;
//#define x first
//#define y second
//ifstream cin("input.txt");
//ofstream cout("output.txt");
//cout << fixed << setprecision(15);
/*
sort(a, a + n, [&](pair<pt, int> a, pair<pt, int> b){if (a.x.x != b.x.x)
        return a.x.x < b.x.x; return a.x.y > b.x.y;});
for(int c : s)
for (int &i : a) cin >> i;
for(int c = 'a'; c <= 'z'; ++c)
vector<vector<ll>> dp(n, vector<ll>(n+2));
__int128;
char 0 = int 48;
char c = cin;
int h = (int)c - 48;
*/

/*char memory[(int)1e8];

char memorypos;

inline void * operator new(size_t n){
    char * ret = memory + memorypos;
    memorypos += n;
    return (void *)ret;
}

inline void operator delete(void *){}
*/

typedef vector<vector<int>> matrix;

matrix mul(matrix a, matrix b) {
    matrix c(a.size(), vector<int>(b[0].size(), 0));
    for(int i = 0; i < a.size(); i++)
        for(int j = 0; j < b[0].size(); j++)
            for(int k = 0; k < b.size(); k++)
                c[i][j] = (c[i][j] + ll(a[i][k]) * b[k][j]) % mod;
    return c;
}

matrix pw(matrix a, int b) {
    assert(b);
    if(b == 1) return a;
    if(b & 1) return mul(pw(a, b - 1), a);
    a = pw(a, b / 2);
    return mul(a, a);
}

int k[101];

int dp[101];

int inline solve() {
    //input;output;
    //fix;
    fast_io;
    int n, x;
    cin >> n >> x;
    for (int i = 0; i < n; ++i) {
        int d;
        cin >> d;
        k[d - 1]++;
    }
    matrix ma(101, vector<int>(101, 0));
    for (int i = 0; i < 99; ++i) {
        ma[i][i + 1] = 1;
    }
    for (int i = 0; i < 100; ++i) {
        ma[99][99 - i] = ma[100][99 - i] = k[i];
    }
    ma[100][100] = 1;
    dp[0] = 1;
    for (int i = 1; i < 100; ++i) {
        for (int j = 0; j < i; ++j) {
            dp[i] = (dp[i] + ll(dp[i - j - 1]) * k[j]) % mod;
        }
    }
    if(x < 100){
        int ans = 0;
        for (int i = 0; i <= x; ++i) {
            ans += dp[i];
            ans %= mod;
        }
        cout << ans;
        return 0;
    }
    matrix a(101, vector<int>(1, 0));
    for (int i = 0; i < 100; ++i) {
        a[i][0] = dp[i];
        a[100][0] = (a[100][0] + dp[i])%mod;
    }
    ma = pw(ma, x - 99);
    cout << mul(ma, a)[100][0];
    return 0;
}
int32_t main() {
    //freopen("mushrooms.in", "r", stdin);
    //freopen("mushrooms.out", "w", stdout);
    solve();
    return 0;
}
/*
4
4 3 5
4 5 2
3 2 1
5 4 1

 * */


#include <bits/stdc++.h>

using namespace std;

const int OO = 1e9;
const double EPS = 1e-9;

#define ndl cout << '\n'
#define sz(v) int(v.size())
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define present(a, x) (a.find(x) != a.end())
#ifdef LOCAL
#define db(...) ({cout << "> Line " << __LINE__  \
		<< ": "; _db(#__VA_ARGS__, __VA_ARGS__);})
#define RNG() rng()
#else
#define db(...) true
#define RNG() true
#endif

template<class T>
void _db(const char *dbStr, T e) {
	cout << dbStr << " = " << e << endl;
}
template<class T, class... L>
void _db(const char *dbStr, T e, L... r) {
  while(*dbStr != ',') cout << *dbStr++;
  cout << " = " << e << ','; _db(dbStr + 1, r...);
}
template<class S, class T>
ostream& operator<<(ostream& o, const map<S, T>& v) {
	o << "["; int i = 0;
	for (const pair<S, T>& pr : v) o << (!i++ ? "" : ", ") << "{"
	<< pr.fs << " : " << pr.sc << "}"; return o << "]";
}
template<template <class, class...> class S, class T, class... L>
ostream& operator<<(ostream& o, const S<T, L...>& v) {
	o << "["; int i = 0;
	for (const auto& e : v) o << (!i++ ? "" : ", ") << e;
	return o << "]";
}
template<class S, class T>
ostream& operator<<(ostream& o, const pair<S, T>& pr) {
	return o << "(" << pr.fs << ", " << pr.sc << ")";
}
ostream& operator<<(ostream& o, const string& s) {
	for (const char& c : s) o << c;
	return o;
}

template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
template<class T> using VVV = VV<V<T>>;
using ll = long long;
using pii = pair<int, int>;
using vi = V<int>;
using vii = V<pii>;
using vvi = VV<int>;
using mii = map<int, int>;
using umii = unordered_map<int, int>;
using si = set<int>;
using usi = unordered_set<int>;

const int MOD = 1000000007;
typedef vector<int> row;
typedef vector<int> col;
typedef vector<row> matrix;

matrix zero(int n, int m) {
	return matrix(n, row(m, 0));
}

matrix identity(int n) {
	matrix ret = zero(n, n);
	for (int i = 0; i < sz(ret); ++i)
		ret[i][i] = 1;
	return ret;
}

matrix multiply(const matrix& a,const matrix&b) {
	matrix ret = zero(a.size(), b[0].size());
	for (int i = 0; i < sz(a); ++i)
		for (int k = 0; k < sz(a[0]); ++k)
			for (int j = 0; j < sz(b[0]); ++j)
				ret[i][j] = (ret[i][j] + a[i][k] * 1LL * b[k][j]) % MOD;
	return ret;
}

matrix matPower(const matrix& a, ll k) {
	if (!k)
		return identity(sz(a));
	if (k % 2 == 1)
		return multiply(a, matPower(a, k - 1));
	return matPower(multiply(a, a), k / 2);
}

int n, x;
vi freq(101), ans(101);

int main() {
	#ifdef LOCAL
	auto stTime = clock();
//	freopen("in.txt", "r", stdin);
	mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
	#endif
	ios::sync_with_stdio(false);
	cout.precision(10);
	cin.tie(0);

	cin >> n >> x;

	for (int i = 1; i <= n; ++i) {
		int di;
		cin >> di;
		++freq[di];
	}

	ans[0] = 1;

	for (int i = 1; i <= 100; ++i) {
		for (int j = 0; j < i; ++j) {
			ans[i] = (ans[i] + freq[i - j] * 1LL * ans[j]) % MOD;
		}
	}

	db(ans);

	if (x <= 100) {

		ll ret = 0;

		for (int i = 0; i <= x; ++i)
			ret = (ret + ans[i]) % MOD;

		cout << ret << '\n';
		return 0;
	}

	matrix m(101, row(1, 0));

	int s = 0;

	for (int i = 1; i <= 100; ++i) {
		m[101 - i][0] = ans[i];
		s = (s + ans[i]) % MOD;
	}

	m[0][0] = s;

	matrix M(101, row(101, 0));

	M[0][0] = 1;

	for (int j = 1; j <= 100; ++j)
		M[0][j] = M[1][j] = freq[j];

	for (int i = 2; i <= 100; ++i)
		M[i][i - 1] = 1;

	M = matPower(M, x - 100);

	cout << multiply(M, m)[0][0] << '\n';

	#ifdef LOCAL
	cout << "\n\n\nExecution time: " <<
		(clock() - stTime) * 1e3 / CLOCKS_PER_SEC << " ms" << endl;
	#endif
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int OO = 1e9;
const double EPS = 1e-9;

#define ndl cout << '\n'
#define sz(v) int(v.size())
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define present(a, x) (a.find(x) != a.end())
#ifdef LOCAL
#define db(...) ({cout << "> Line " << __LINE__  \
		<< ": "; _db(#__VA_ARGS__, __VA_ARGS__);})
#define RNG() rng()
#else
#define db(...) true
#define RNG() true
#endif

template<class T>
void _db(const char *dbStr, T e) {
	cout << dbStr << " = " << e << endl;
}
template<class T, class... L>
void _db(const char *dbStr, T e, L... r) {
  while(*dbStr != ',') cout << *dbStr++;
  cout << " = " << e << ','; _db(dbStr + 1, r...);
}
template<class S, class T>
ostream& operator<<(ostream& o, const map<S, T>& v) {
	o << "["; int i = 0;
	for (const pair<S, T>& pr : v) o << (!i++ ? "" : ", ") << "{"
	<< pr.fs << " : " << pr.sc << "}"; return o << "]";
}
template<template <class, class...> class S, class T, class... L>
ostream& operator<<(ostream& o, const S<T, L...>& v) {
	o << "["; int i = 0;
	for (const auto& e : v) o << (!i++ ? "" : ", ") << e;
	return o << "]";
}
template<class S, class T>
ostream& operator<<(ostream& o, const pair<S, T>& pr) {
	return o << "(" << pr.fs << ", " << pr.sc << ")";
}
ostream& operator<<(ostream& o, const string& s) {
	for (const char& c : s) o << c;
	return o;
}

template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
template<class T> using VVV = VV<V<T>>;
using ll = long long;
using pii = pair<int, int>;
using vi = V<int>;
using vii = V<pii>;
using vvi = VV<int>;
using mii = map<int, int>;
using umii = unordered_map<int, int>;
using si = set<int>;
using usi = unordered_set<int>;

const int MOD = 1000000007;
typedef vector<int> row;
typedef vector<int> col;
typedef vector<row> matrix;

matrix zero(int n, int m) {
	return matrix(n, row(m, 0));
}

matrix identity(int n) {
	matrix ret = zero(n, n);
	for (int i = 0; i < sz(ret); ++i)
		ret[i][i] = 1;
	return ret;
}

matrix multiply(const matrix& a,const matrix&b) {
	matrix ret = zero(a.size(), b[0].size());
	for (int i = 0; i < sz(a); ++i)
		for (int k = 0; k < sz(a[0]); ++k)
			for (int j = 0; j < sz(b[0]); ++j)
				ret[i][j] = (ret[i][j] + a[i][k] * 1LL * b[k][j]) % MOD;
	return ret;
}

matrix matPower(const matrix& a, ll k) {
	if (!k)
		return identity(sz(a));
	if (k % 2 == 1)
		return multiply(a, matPower(a, k - 1));
	return matPower(multiply(a, a), k / 2);
}

int n, x;
vi freq(101), ans(101);

int main() {
	#ifdef LOCAL
	auto stTime = clock();
//	freopen("in.txt", "r", stdin);
	mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
	#endif
	ios::sync_with_stdio(false);
	cout.precision(10);
	cin.tie(0);

	cin >> n >> x;

	for (int i = 1; i <= n; ++i) {
		int di;
		cin >> di;
		++freq[di];
	}

	ans[0] = 1;

	for (int i = 1; i <= 100; ++i) {
		for (int j = 0; j < i; ++j) {
			ans[i] = (ans[i] + freq[i - j] * 1LL * ans[j]) % MOD;
		}
	}

	db(ans);

	if (x <= 100) {

		ll ret = 0;

		for (int i = 0; i <= x; ++i)
			ret = (ret + ans[i]) % MOD;

		cout << ret << '\n';
		return 0;
	}

	matrix m(101, row(1, 0));

	int s = 1;

	for (int i = 1; i <= 100; ++i) {
		m[101 - i][0] = ans[i];
		s = (s + ans[i]) % MOD;
	}

	m[0][0] = s;

	matrix M(101, row(101, 0));

	M[0][0] = 1;

	for (int j = 1; j <= 100; ++j)
		M[0][j] = M[1][j] = freq[j];

	for (int i = 2; i <= 100; ++i)
		M[i][i - 1] = 1;

	M = matPower(M, x - 100);

	cout << multiply(M, m)[0][0] << '\n';

	#ifdef LOCAL
	cout << "\n\n\nExecution time: " <<
		(clock() - stTime) * 1e3 / CLOCKS_PER_SEC << " ms" << endl;
	#endif
	return 0;
}


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

#define llong long long
#define xx first
#define yy second
#define len(x) ((int)x.size())
#define rep(i,n) for (int i = -1; ++ i < n; )
#define rep1(i,n) for (int i = 0; i ++ < n; )
#define all(x) x.begin(), x.end()

#define rem ((llong)1e9+7)

struct matrix {
  vector<vector<llong>> data;
  matrix(int n, int m) {
    data.resize(n, vector<llong>(m));
  }

  vector<llong>& operator[](int i) { return data[i]; }
  const vector<llong>& operator[](int i) const { return data[i]; }

  inline int nrow() const { return len(data); }
  inline int ncol() const { return len(data[0]); }

  static matrix iden(int n) {
    matrix ans(n, n);
    rep(i, n) ans[i][i] = 1;
    return ans;
  }

  matrix operator* (const matrix& other) {
    assert(ncol() == other.nrow());
    matrix ans(nrow(), other.ncol());
    rep(i, nrow())
    rep(f, other.ncol())
    rep(g, ncol())
      (ans[i][f] += (data[i][g] * other[g][f]) % rem) %= rem;
    return ans;
  }

  matrix pow(llong n) {
    assert(nrow() == ncol());
    matrix ans = matrix::iden(nrow());
    matrix base = *this;
    for (; n > 0; n >>= 1) {
      if (n & 1) ans = ans * base;
      base = base * base;
    }
    return ans;
  }
};

int n;
llong x;

int main(void) {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> x;
    matrix coef(102, 102);
    rep1(i, 99) coef[i][i - 1] = 1;
    coef[101][101] = 1;
    coef[101][0] = 1;
    rep(i, n) {
      int u; cin >> u;
      coef[0][u - 1] ++;
    }

    // rep(i, 10) {
      // rep(f, 10) clog << coef[i][f] << ' ';
      // clog << endl;
    // }

    matrix base(102, 1);
    base[0][0] = 1;

    base = coef.pow(x + 1) * base;

    // rep1(i, x + 1) {
      // clog << i << ' ';
      // base = coef * base;
      // clog << (base)[101][0] << endl;
    // }

    cout << base[101][0];

    return 0;
}


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

#define llong long long
#define xx first
#define yy second
#define len(x) ((int)x.size())
#define rep(i,n) for (int i = -1; ++ i < n; )
#define rep1(i,n) for (int i = 0; i ++ < n; )
#define all(x) x.begin(), x.end()

#define rem ((llong)1e9+7)

struct matrix : public vector<vector<llong>>{
  matrix(int n, int m) {
    resize(n, vector<llong>(m));
  }

  inline int nrow() const { return (int)size(); }
  inline int ncol() const { return len(at(0)); }

  static matrix iden(int n) {
    matrix ans(n, n);
    rep(i, n) ans[i][i] = 1;
    return ans;
  }

  matrix operator* (const matrix& other) {
    assert(ncol() == other.nrow());
    matrix ans(nrow(), other.ncol());
    rep(i, nrow())
    rep(f, other.ncol())
    rep(g, ncol())
      (ans[i][f] += (at(i)[g] * other[g][f]) % rem) %= rem;
    return ans;
  }

  matrix pow(llong n) {
    assert(nrow() == ncol());
    matrix ans = matrix::iden(nrow());
    matrix base = *this;
    for (; n > 0; n >>= 1) {
      if (n & 1) ans = ans * base;
      base = base * base;
    }
    return ans;
  }
};

int n;
llong x;

int main(void) {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> x;
    matrix coef(102, 102);
    rep1(i, 99) coef[i][i - 1] = 1;
    coef[101][101] = 1;
    coef[101][0] = 1;
    rep(i, n) {
      int u; cin >> u;
      coef[0][u - 1] ++;
    }

    // rep(i, 10) {
      // rep(f, 10) clog << coef[i][f] << ' ';
      // clog << endl;
    // }

    matrix base(102, 1);
    base[0][0] = 1;

    base = coef.pow(x + 1) * base;

    // rep1(i, x + 1) {
      // clog << i << ' ';
      // base = coef * base;
      // clog << (base)[101][0] << endl;
    // }

    cout << base[101][0];

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define dbg(x) cerr<<#x": "<<(x)<<endl
#define dbg_p(x) cerr<<#x": "<<(x).first<<' '<<(x).second<<endl
#define dbg_v(x, n) {cerr<<#x"[]: ";for(long long _=0;_<n;++_)cerr<<(x)[_]<<' ';cerr<<endl;}
#define all(v) v.begin(), v.end()
#define fi first
#define se second

template<typename T1, typename T2>
ostream& operator <<(ostream &out, const pair<T1, T2> &item) {
	out << '(' << item.first << ", " << item.second << ')';
	return out;
}

template<typename T>
ostream& operator <<(ostream &out, const vector<T> &v) {
	for(const auto &item : v) out << item << ' ';
	return out;
}

const int N = 100010;
const int D = 100;
const int MOD = 1000000007;

template<int N, class T = int>
struct Matrix {
	T a[N][N];

	Matrix() {
		memset(a, 0, sizeof a);
	}

	static Matrix identity() {
		Matrix<N> res;
		for(int i = 0; i < N; ++i) res.a[i][i] = 1;
		return res;
	}

	friend Matrix operator *(const Matrix &a, const Matrix &b) {
		Matrix<N> c;

		for(int i = 0; i < N; ++i)
			for(int j = 0; j < N; ++j)
				for(int k = 0; k < N; ++k)
					c.a[i][j] = (c.a[i][j] + 1LL * a.a[i][k] * b.a[k][j]) % MOD;

		return c;
	}

	friend Matrix pw(Matrix base, int exp) {
		Matrix<N> res = identity();

		for(; exp; exp >>= 1) {
			if(exp & 1) res = res * base;
			base = base * base;
		}

		return res;
	}
};

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

int d[N], dp[D];

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

	int n, x;

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

	dp[0] = 1;
	for(int i = 1; i < D; ++i) {
		dp[i] = 1;
		for(int j = 1; j <= n; ++j)
			if(i - d[j] >= 0) add(dp[i], dp[i - d[j]]);
	}

	if(x < D) return cout << dp[x] << '\n', 0;

	Matrix<D + 1> m;

	m.a[0][0] = 1;
	for(int i = 1; i < D; ++i) m.a[i + 1][i] = 1;

	m.a[0][D] = 1;
	for(int i = 1; i <= n; ++i) ++m.a[D + 1 - d[i]][D];

	m = pw(m, x - D + 1);

	int ans = m.a[0][D];
	for(int i = 0; i < D; ++i) {
		ans = (ans + 1LL * dp[i] * m.a[i + 1][D]) % MOD;
	}

	cout << ans << '\n';

	return 0;
}


#include <bits/stdc++.h>
#define dbg(x) cerr<<#x<<" = "<<x<<endl;
#define dbg_v(v,n) {cerr<<#v<<" = [";for(int III=0;III<=n;III++)cerr<<v[III]<<(III!=n?",":"]\n");}
#define ll long long
#define ld long double
#define pii pair<int,int>
#define MOD 1000000007
#define zeros(x) x&(x-1)^x
#define Nmax 103
using namespace std;

int n,x,v[Nmax],y,v2[Nmax];
vector<vector<int>> mat;

vector<vector<int>> mult(vector<vector<int>> A, vector<vector<int>> B){
	vector<vector<int>> C;
	C.resize(101);
	for (int i=1;i<=100;i++) C[i].resize(101);

	for (int i=1;i<=100;i++){
		for (int j=1;j<=100;j++){
			for (int k=1;k<=100;k++){
				C[i][j] = (C[i][j] + 1LL * A[i][k] * B[k][j]) % MOD;
			}
		}
	}
	return C;
}

vector<vector<int>> _pow(vector<vector<int>> mat, int x){
	if (x==1) return mat;

	vector<vector<int>> ansM = _pow(mult(mat,mat), x/2);
	if (x%2)
		mult(ansM, mat);
	return ansM;
}

int main(){
    ios::sync_with_stdio(false);
	cin >> n >> x;
	for (int i=1;i<=n;i++){
		cin >> y;
		v[y]++;
	}
	mat.resize(101);
	for (int i=1;i<=100;i++) mat[i].resize(101);
	// matrice pentru recurenta tip fibonacci
	for (int i=2;i<=100;i++) mat[i][i-1] = 1;
	for (int i=1;i<=100;i++) mat[1][i] = v[i];
	// ca sa fac suma lor, nu doar ultimul element
	mat[1][100] = 1;

	ll ans = 0;

	for (int i=1;i<=100;i++){
		v2[i] = v[i];
		for (int j=1;j<i;j++){
			v2[i] = (v2[i] + 1LL * v2[i-j] * v[j]) % MOD;
		}
	}

	// dbg_v(v2,3);

	if (x > 100){
		vector<vector<int>> ansM = _pow(mat, x-100);
		for (int i=1;i<=100;i++){
			ans = (ans + 1LL * ansM[1][i] * v2[i]) % MOD;
		}
	}

	for (int i=1;i<=min(x,100);i++){
		ans = (ans + v2[i]) % MOD;
	}

	cout << (ans + 1) % MOD << '\n';

    return 0;
}


#include <bits/stdc++.h>
#define dbg(x) cerr<<#x<<" = "<<x<<endl;
#define dbg_v(v,n) {cerr<<#v<<" = [";for(int III=0;III<=n;III++)cerr<<v[III]<<(III!=n?",":"]\n");}
#define ll long long
#define ld long double
#define pii pair<int,int>
#define MOD 1000000007
#define zeros(x) x&(x-1)^x
#define Nmax 1003
using namespace std;

int n,x,v[Nmax],y,v2[Nmax];
vector<vector<int>> mat;

vector<vector<int>> mult(vector<vector<int>> A, vector<vector<int>> B){
	vector<vector<int>> C;
	C.resize(102);
	for (int i=1;i<=101;i++) C[i].resize(102);

	for (int i=1;i<=101;i++){
		for (int j=1;j<=101;j++){
			for (int k=1;k<=101;k++){
				C[i][j] = (C[i][j] + 1LL * A[i][k] * B[k][j]) % MOD;
			}
		}
	}
	return C;
}

vector<vector<int>> _pow(vector<vector<int>> mat, int x){
	if (x==1) return mat;

	vector<vector<int>> ansM = _pow(mult(mat,mat), x/2);
	if (x%2)
		return mult(ansM, mat);
	return ansM;
}

int main(){
    ios::sync_with_stdio(false);
	cin >> n >> x;
	for (int i=1;i<=n;i++){
		cin >> y;
		v[y]++;
	}
	mat.resize(102);
	for (int i=1;i<=101;i++) mat[i].resize(102);

	for (int i=2;i<=100;i++) mat[i][i-1] = 1;
	for (int i=1;i<=100;i++) mat[i][100] = mat[i][101] = v[100-i+1];
	mat[101][101] = 1;

	ll ans = 0;

	for (int i=1;i<=100;i++){
		v2[i] = v[i];
		for (int j=1;j<i;j++){
			v2[i] = (v2[i] + 1LL * v2[i-j] * v[j]) % MOD;
		}
	}

	if (x > 100){
		vector<vector<int>> ansM = _pow(mat, x-100);
		for (int i=1;i<=100;i++) v2[101] = (v2[101] + v2[i]) % MOD;
		for (int i=1;i<=101;i++){
			ans = (ans + 1LL * ansM[i][101] * v2[i]) % MOD;
		}
	// for (int i=1;i<=100;i++, cout << '\n')
	// 	for (int j=1;j<=100;j++) cout << ansM[i][j] << ' ';
	}
	else{
		for (int i=1;i<=x;i++){
			ans = (ans + v2[i]) % MOD;
		}
	}

	cout << (ans + 1) % MOD << '\n';

	// for (int i=101;i<=1000;i++){
	// 	v2[i] = v[i];
	// 	for (int j=1;j<i;j++){
	// 		v2[i] = (v2[i] + 1LL * v2[i-j] * v[j]) % MOD;
	// 	}
	// }
	// ans = 1;
	// for (int i=1;i<=x;i++) ans = (ans + v2[i]) % MOD;
	// cout << ans << '\n';

    return 0;
}


#include <iostream>
using namespace std;
long long int n,x,i,j,k,temp[101][101],arr[101][101]={{1}},mod=1000000007;
void multiply(long long int A[101][101],long long int B[101][101]){
    for(i=0;i<=100;++i) for(j=0;j<=100;++j) for(temp[i][j]=0,k=0;k<=100;++k) temp[i][j]=(temp[i][j]+(A[i][k]*B[k][j]))%mod;
    for(i=0;i<=100;++i) for(j=0;j<=100;++j) A[i][j] = temp[i][j];
}
long long int power(){
    long long int res[101][101];
    for(i=0;i<=100;++i) res[i][i] = 1;
    for(x+=1;x>0;x>>=1,multiply(arr,arr)) if(x&1) multiply(res,arr);
    return res[1][0];
}
int main(){
    ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
    for(i=1,cin>>n>>x;i<=100;++i) arr[i][i-1] = 1;
    for(i=0;i<n;++arr[1][j],++i) cin>>j;
    cout<<power()<<"\n";
    return 0;
}


//#pragma GCC optimize(3)
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
typedef long long LL;
using namespace std;
#define MAXN 200005
#define eps (1e-11)
#define lyh 998244353
#define pp 1000000007
const int INF = 1e9;
const double pi = acos(-1.0);
#define P pair<int,int>
#define se second
#define fi first
#define MP(i,j) make_pair(i,j)
#define int LL

//矩阵快速幂模板
struct Matrix {
	int m[101][101];
	Matrix() {
		memset(m, 0, sizeof(m));
	}
};
Matrix Multi(Matrix a, Matrix b) {
	Matrix res;
	for (int i = 0; i < 101; i++) {
		for (int j = 0; j < 101; j++) {
			for (int k = 0; k < 101; k++) {
				res.m[i][j] += (a.m[i][k] * b.m[k][j]) % pp;
				res.m[i][j] %= pp;
			}
		}
	}
	return res;
}
Matrix quickm(Matrix a, int n) {
	Matrix res;
	for (int i = 0; i < 101; i++) {
		res.m[i][i] = 1;
	}
	while (n) {
		if (n & 1) {
			res = Multi(res, a);
		}
		a = Multi(a, a);
		n >>= 1;
	}
	return res;
}

int dp[105];
int tong[105];

void init() {
	dp[0] = 1;
	//tong[0] = 1;
	for (int i = 1; i <= 100; i++) {
		for (int j = 1; j <= i; j++) {
			dp[i] += dp[i - j] * (tong[j]);
			dp[i] %= pp;
		}
	}
}

signed main() {
	int n, x;
	scanf("%lld%lld", &n, &x);
	for (int i = 0; i < n; i++) {
		int tmp;
		scanf("%lld", &tmp);
		tong[tmp]++;
	}
	if (x == 0) {
		printf("1");
	}
	else {
		Matrix m;
		for (int i = 0; i < 100; i++) m.m[i][i + 1] = 1;
		for (int i = 0; i < 100; i++) m.m[99][i] = tong[100 - i];
		m.m[100][100] = 1; m.m[100][0] = 1;
		m = quickm(m, x);
		init();
		if (x <= 100) {
			int ans = 0;
			for (int i = 0; i <= x; i++) {
				ans += dp[i];
				ans %= pp;
			}
			printf("%lld", ans);
		}
		else {
			int ans = 0;
			for (int i = 0; i < 100; i++) {
				ans += m.m[100][i] * dp[i + 1]; ans %= pp;
			}
			ans += m.m[100][100]; ans %= pp;
			printf("%lld", ans);
		}
	}
	return 0;
}


//#pragma GCC optimize(3)
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
typedef long long LL;
using namespace std;
#define MAXN 200005
#define eps (1e-11)
#define lyh 998244353
#define pp 1000000007
const int INF = 1e9;
const double pi = acos(-1.0);
#define P pair<int,int>
#define se second
#define fi first
#define MP(i,j) make_pair(i,j)
#define int LL

//矩阵快速幂模板
struct Matrix {
	int m[101][101];
	Matrix() {
		memset(m, 0, sizeof(m));
	}
};
Matrix Multi(Matrix a, Matrix b) {
	Matrix res;
	for (int i = 0; i < 101; i++) {
		for (int j = 0; j < 101; j++) {
			for (int k = 0; k < 101; k++) {
				res.m[i][j] += (a.m[i][k] * b.m[k][j]) % pp;
				res.m[i][j] %= pp;
			}
		}
	}
	return res;
}
Matrix quickm(Matrix a, int n) {
	Matrix res;
	for (int i = 0; i < 101; i++) {
		res.m[i][i] = 1;
	}
	while (n) {
		if (n & 1) {
			res = Multi(res, a);
		}
		a = Multi(a, a);
		n >>= 1;
	}
	return res;
}

int dp[105];
int tong[105];

void init() {
	dp[0] = 1;
	//tong[0] = 1;
	for (int i = 1; i <= 100; i++) {
		for (int j = 1; j <= i; j++) {
			dp[i] += dp[i - j] * (tong[j]);
			dp[i] %= pp;
		}
	}
}

signed main() {
	int n, x;
	scanf("%lld%lld", &n, &x);
	for (int i = 0; i < n; i++) {
		int tmp;
		scanf("%lld", &tmp);
		tong[tmp]++;
	}
	if (x == 0) {
		printf("1");
	}
	else {
		Matrix m;
		for (int i = 0; i < 99; i++) m.m[i][i + 1] = 1;
		for (int i = 0; i < 100; i++) m.m[99][i] = tong[100 - i];
		m.m[100][100] = 1; m.m[100][0] = 1;
		m = quickm(m, x);
		init();
		if (x <= 100) {
			int ans = 0;
			for (int i = 0; i <= x; i++) {
				ans += dp[i];
				ans %= pp;
			}
			printf("%lld", ans);
		}
		else {
			int ans = 0;
			for (int i = 0; i < 100; i++) {
				ans += m.m[100][i] * dp[i + 1]; ans %= pp;
			}
			ans += m.m[100][100]; ans %= pp;
			printf("%lld", ans);
		}
	}
	return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const ll mod = 1e9 + 7;
const int N = 105;
ll dp[N], f[N];

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

void modPow(ll a[N][N], ll b, ll ret[N][N]){
	for(int i = 0; i <= 100; i++){
		for(int j = 0; j <= 100; j++){
			ret[i][j] = (i == j);
		}
	}
	ll c[N][N];
	while(b){
		if(b&1){
			product(ret, a, c);
			for(int i = 0; i <= 100; i++){
				for(int j = 0; j <= 100; j++){
					ret[i][j] = c[i][j];
				}
			}
		}
		product(a, a, c);
		for(int i = 0; i <= 100; i++){
			for(int j = 0; j <= 100; j++){
				a[i][j] = c[i][j];
			}
		}
		b >>= 1;
	}
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout<<setprecision(32);

	int n, x;
	cin>>n>>x;
	memset(f, 0, sizeof(f));
	for(int i = 0; i < n; i++){
		int y;
		cin>>y;
		f[y]++;
	}
	dp[0] = 1;
	for(int i = 1; i <= 100; i++){
		dp[i] = 1;
		for(int j = 0; j <= i; j++){
			dp[i] += f[j]*dp[i - j];
		}
		dp[i] %= mod;
	}
	if(x <= 100){
		cout<<dp[x]<<'\n';
		exit(0);
	}
	ll A[N][N];
	f[0] = 1;
	for(int i = 0; i <= 100; i++){
		for(int j = 0; j <= 100; j++){
			if(i == 0)A[i][j] = (j == 0);
			else if(i == 1)A[i][j] = f[j];
			else A[i][j] = (i == j + 1);
		}
	}
	ll B[N][N];
	modPow(A, x - 100, B);
	ll ans = B[1][0];
	for(int i = 1; i <= 100; i++){
		ans += B[1][i]*dp[101 - i]%mod;
	}
	ans %= mod;
	cout<<ans<<'\n';

	return 0;
}


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

typedef unsigned short us;
typedef short s;
typedef unsigned long ul;
typedef long l;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

const l INF = 1e9 + 9;
const l MOD = 1e9 + 7;
const l PRIME = 200003;
const ll L_INF = 1e18 + 1;
const double EPS = 10e-9;

#define FOR(x, y, z) for (l z = x; z < y; z++)
#define FORE(x, y, z) for (l z = x; z <= y; z++)
#define FORD(x, y, z) for (l z = x; z > y; z--)
#define FORDE(x, y, z) for (l z = x; z >= y; z--)
#define REP(x, y) for (l y = 0; y < x; y++)

#define PF push_front
#define POF pop_front
#define PB push_back
#define POB pop_back
#define MP make_pair

using namespace std;
using namespace __gnu_pbds;

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> statistics_set;

const l n = 101;
l num_nodes, dist;
ll answer = 0;
l cnt[105];
ll dp[105];
vector<vector<ll> > matrix;

vector<vector<ll> > mul(vector<vector<ll> > A, vector<vector<ll> > B)
{
	vector<vector<ll> > C;
	C.assign(n, vector<ll>(n, 0));

	REP(n, i)
		REP(n, k)
			REP(n, j)
				C[i][j] = (C[i][j] + (A[i][k]*B[k][j])%MOD)%MOD;

	return C;
}

vector<vector<ll> > fastExponential(vector<vector<ll> > A, l k)
{
	vector<vector<ll> > W;
	W.assign(n, vector<ll>(n, 0));

	REP(n, i)
		W[i][i] = 1;

	while(k)
	{
		if(k%2 == 1)
			W = mul(W, A);

		A = mul(A, A);
		k >>= 1;
	}

	return W;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin >> num_nodes >> dist;

	REP(num_nodes, i)
	{
		l a;
		cin >> a;
		cnt[a]++;
	}

	dp[0] = 1;
	dp[1] = cnt[1];

	FORE(2, 100, i)
	{
		FORE(1, 100, j)
		{
			if(i - j >= 0)
				dp[i] = (dp[i] + (cnt[j]*dp[i-j])%MOD)%MOD;

			else
				break;
		}
	}

	if(dist <= 100)
	{
		FORE(0, dist, i)
			answer = (answer + dp[i])%MOD;

		cout << answer << "\n";
	}

	else
	{
		matrix.assign(n, vector<ll>(n, 0));

		REP(n-2, i)
			matrix[n - (i+2)][i] = 1;

		FORE(1, n-1, i)
		{
			matrix[i][n-1] = cnt[i];
			matrix[i][n-2] = cnt[i];
		}

		matrix[0][n-1] = 1;

		/*REP(20, i)
		{
			REP(20, j)
				cout << matrix[19-i][j+81] << " ";

			cout << endl;
		}*/

		matrix = fastExponential(matrix, dist-100);

		vector<vector<ll> > W;
		W.assign(1, vector<ll>(n, 0));
		vector<vector<ll> > A;
		A.assign(1, vector<ll>(n, 0));

		REP(n-1, i)
			A[0][i] = dp[i+1];

		FORE(0, 100, i)
			A[0][n] = (A[0][n] + dp[i])%MOD;

		REP(1, i)
			REP(n, k)
				REP(n, j)
					W[i][j] = (W[i][j] + (A[i][k]*matrix[k][j])%MOD)%MOD;

		cout << W[0][n-1] << "\n";
	}
}


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

typedef unsigned short us;
typedef short s;
typedef unsigned long ul;
typedef long l;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

const l INF = 1e9 + 9;
const l MOD = 1e9 + 7;
const l PRIME = 200003;
const ll L_INF = 1e18 + 1;
const double EPS = 10e-9;

#define FOR(x, y, z) for (l z = x; z < y; z++)
#define FORE(x, y, z) for (l z = x; z <= y; z++)
#define FORD(x, y, z) for (l z = x; z > y; z--)
#define FORDE(x, y, z) for (l z = x; z >= y; z--)
#define REP(x, y) for (l y = 0; y < x; y++)

#define PF push_front
#define POF pop_front
#define PB push_back
#define POB pop_back
#define MP make_pair

using namespace std;
using namespace __gnu_pbds;

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> statistics_set;

const l n = 101;
l num_nodes, dist;
ll answer = 0;
l cnt[105];
ll dp[105];
vector<vector<ll> > matrix;

vector<vector<ll> > mul(vector<vector<ll> > A, vector<vector<ll> > B)
{
	vector<vector<ll> > C;
	C.assign(n, vector<ll>(n, 0));

	REP(n, i)
		REP(n, k)
			REP(n, j)
				C[i][j] = (C[i][j] + (A[i][k]*B[k][j])%MOD)%MOD;

	return C;
}

vector<vector<ll> > fastExponential(vector<vector<ll> > A, l k)
{
	vector<vector<ll> > W;
	W.assign(n, vector<ll>(n, 0));

	REP(n, i)
		W[i][i] = 1;

	while(k)
	{
		if(k%2 == 1)
			W = mul(W, A);

		A = mul(A, A);
		k >>= 1;
	}

	return W;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin >> num_nodes >> dist;

	REP(num_nodes, i)
	{
		l a;
		cin >> a;
		cnt[a]++;
	}

	dp[0] = 1;
	dp[1] = cnt[1];

	FORE(2, 100, i)
	{
		FORE(1, 100, j)
		{
			if(i - j >= 0)
				dp[i] = (dp[i] + (cnt[j]*dp[i-j])%MOD)%MOD;

			else
				break;
		}
	}

	if(dist <= 100)
	{
		FORE(0, dist, i)
			answer = (answer + dp[i])%MOD;

		cout << answer << "\n";
	}

	else
	{
		matrix.assign(n, vector<ll>(n, 0));

		REP(n-2, i)
			matrix[i+1][i] = 1;

		FORE(0, n-1, i)
		{
			matrix[i][n-1] = cnt[n-i-1];
			matrix[i][n-2] = cnt[n-i-1];
		}

		matrix[n-1][n-1] = 1;

		/*REP(20, i)
		{
			REP(20, j)
				cout << matrix[i+81][j+81] << " ";

			cout << endl;
		}*/

		matrix = fastExponential(matrix, dist-100);

		vector<vector<ll> > W;
		W.assign(1, vector<ll>(n, 0));
		vector<vector<ll> > A;
		A.assign(1, vector<ll>(n, 0));

		REP(n-1, i)
			A[0][i] = dp[i+1];

		FORE(0, 100, i)
			A[0][n-1] = (A[0][n-1] + dp[i])%MOD;

		REP(1, i)
			REP(n, k)
				REP(n, j)
					W[i][j] = (W[i][j] + (A[i][k]*matrix[k][j])%MOD)%MOD;

		cout << W[0][n-1] << "\n";
	}
}


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

typedef unsigned short us;
typedef short s;
typedef unsigned long ul;
typedef long l;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

const l INF = 1e9 + 9;
const l MOD = 1e9 + 7;
const l PRIME = 200003;
const ll L_INF = 1e18 + 1;
const double EPS = 10e-9;

#define FOR(x, y, z) for (l z = x; z < y; z++)
#define FORE(x, y, z) for (l z = x; z <= y; z++)
#define FORD(x, y, z) for (l z = x; z > y; z--)
#define FORDE(x, y, z) for (l z = x; z >= y; z--)
#define REP(x, y) for (l y = 0; y < x; y++)

#define PF push_front
#define POF pop_front
#define PB push_back
#define POB pop_back
#define MP make_pair

using namespace std;
using namespace __gnu_pbds;

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> statistics_set;

const l n = 101;
l num_nodes, dist;
ll answer = 0;
l cnt[105];
ll dp[105];
vector<vector<ll> > matrix;

vector<vector<ll> > mul(vector<vector<ll> > A, vector<vector<ll> > B)
{
	vector<vector<ll> > C;
	C.assign(n, vector<ll>(n, 0));

	REP(n, i)
		REP(n, k)
			REP(n, j)
				C[i][j] = (C[i][j] + (A[i][k]*B[k][j])%MOD)%MOD;

	return C;
}

vector<vector<ll> > fastExponential(vector<vector<ll> > A, l k)
{
	vector<vector<ll> > W;
	W.assign(n, vector<ll>(n, 0));

	REP(n, i)
		W[i][i] = 1;

	while(k)
	{
		if(k%2 == 1)
			W = mul(W, A);

		A = mul(A, A);
		k >>= 1;
	}

	return W;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin >> num_nodes >> dist;

	REP(num_nodes, i)
	{
		l a;
		cin >> a;
		cnt[a]++;
	}

	dp[0] = 1;
	dp[1] = cnt[1];

	FORE(2, 100, i)
	{
		FORE(1, 100, j)
		{
			if(i - j >= 0)
				dp[i] = (dp[i] + (cnt[j]*dp[i-j])%MOD)%MOD;

			else
				break;
		}
	}

	if(dist <= 100)
	{
		FORE(0, dist, i)
			answer = (answer + dp[i])%MOD;

		cout << answer << "\n";
	}

	else
	{
		matrix.assign(n, vector<ll>(n, 0));

		REP(n-2, i)
			matrix[n - (i+2)][i] = 1;

		FORE(1, n-1, i)
		{
			matrix[i][n-1] = cnt[i];
			matrix[i][n-2] = cnt[i];
		}

		matrix[0][n-1] = 1;

		/*REP(20, i)
		{
			REP(20, j)
				cout << matrix[19-i][j+81] << " ";

			cout << endl;
		}*/

		matrix = fastExponential(matrix, dist-100);

		vector<vector<ll> > W;
		W.assign(1, vector<ll>(n, 0));
		vector<vector<ll> > A;
		A.assign(1, vector<ll>(n, 0));

		REP(n-1, i)
			A[0][i] = dp[i+1];

		FORE(0, 100, i)
			A[0][n-1] = (A[0][n-1] + dp[i])%MOD;

		REP(1, i)
			REP(n, k)
				REP(n, j)
					W[i][j] = (W[i][j] + (A[i][k]*matrix[k][j])%MOD)%MOD;

		cout << W[0][n-1] << "\n";
	}
}


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

typedef unsigned short us;
typedef short s;
typedef unsigned long ul;
typedef long l;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

const l INF = 1e9 + 9;
const l MOD = 1e9 + 7;
const l PRIME = 200003;
const ll L_INF = 1e18 + 1;
const double EPS = 10e-9;

#define FOR(x, y, z) for (l z = x; z < y; z++)
#define FORE(x, y, z) for (l z = x; z <= y; z++)
#define FORD(x, y, z) for (l z = x; z > y; z--)
#define FORDE(x, y, z) for (l z = x; z >= y; z--)
#define REP(x, y) for (l y = 0; y < x; y++)

#define PF push_front
#define POF pop_front
#define PB push_back
#define POB pop_back
#define MP make_pair

using namespace std;
using namespace __gnu_pbds;

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> statistics_set;

const l n = 101;
l num_nodes, dist;
ll answer = 0;
l cnt[105];
ll dp[105];
vector<vector<ll> > matrix;

vector<vector<ll> > mul(vector<vector<ll> > A, vector<vector<ll> > B)
{
	vector<vector<ll> > C;
	C.assign(n, vector<ll>(n, 0));

	REP(n, i)
		REP(n, k)
			REP(n, j)
				C[i][j] = (C[i][j] + (A[i][k]*B[k][j])%MOD)%MOD;

	return C;
}

vector<vector<ll> > fastExponential(vector<vector<ll> > A, l k)
{
	vector<vector<ll> > W;
	W.assign(n, vector<ll>(n, 0));

	REP(n, i)
		W[i][i] = 1;

	while(k)
	{
		if(k%2 == 1)
			W = mul(W, A);

		A = mul(A, A);
		k >>= 1;
	}

	return W;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin >> num_nodes >> dist;

	REP(num_nodes, i)
	{
		l a;
		cin >> a;
		cnt[a]++;
	}

	dp[0] = 1;
	dp[1] = cnt[1];

	FORE(2, 100, i)
	{
		FORE(1, 100, j)
		{
			if(i - j >= 0)
				dp[i] = (dp[i] + (cnt[j]*dp[i-j])%MOD)%MOD;

			else
				break;
		}
	}

	if(dist <= 100)
	{
		FORE(0, dist, i)
			answer = (answer + dp[i])%MOD;

		cout << answer << "\n";
	}

	else
	{
		matrix.assign(n, vector<ll>(n, 0));

		REP(n-2, i)
			matrix[n - (i+2)][i] = 1;

		FORE(1, n-1, i)
		{
			matrix[i][n-1] = cnt[i];
			matrix[i][n-2] = cnt[i];
		}

		matrix[0][n-1] = 1;

		/*REP(20, i)
		{
			REP(20, j)
				cout << matrix[19-i][j+81] << " ";

			cout << endl;
		}*/

		matrix = fastExponential(matrix, dist-100);

		vector<vector<ll> > W;
		W.assign(1, vector<ll>(n, 0));
		vector<vector<ll> > A;
		A.assign(1, vector<ll>(n, 0));

		REP(n, i)
			A[0][i] = dp[i+1];

		FORE(0, 100, i)
			A[0][n] = (A[0][n] + dp[i])%MOD;

		REP(1, i)
			REP(n, k)
				REP(n, j)
					W[i][j] = (W[i][j] + (A[i][k]*matrix[k][j])%MOD)%MOD;

		cout << W[0][n-1] << "\n";
	}
}


#include <bits/stdc++.h>
#include <random>
#include <ctime>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("avx2")
#define ll long long
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define pll pair<ll,ll>
#define ld long double
#define pld pair<ld,ld>
#define pii pair<int,int>
#define sqr(a) ((a)*(a))
#define all(v) v.begin(),v.end()

using namespace std;
//using namespace __gnu_pbds;

const ll MOD = 1e9+7;
const ll INF=1e18;
const ld E=1e-8;
mt19937_64 rnd(time(0));
ll p1 = 31, p2 = 29, p3 = 7, p4=rnd()%100+1, md1 = MOD, md2 = 998244353, md3=998244357, md4=rnd()%1000000000;

//using ord_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

ll n, m, k, h, T, q, a[1000001];

ll binpow(ll h, ll r, ll md = MOD)
{
    ll l = 1;
    while (r)
    {
        if (r & 1) l *= h, l %= md;
        h *= h;
        h %= md;
        r /= 2;
    }
    return l;
}

ll gcd(ll x, ll y)
{
    if (x < y) swap(x, y);
    while (x && y)
    {
        x %= y;
        swap(x, y);
    }
    return x + y;
}

struct matrix
{
    ll b[110][110];

    matrix(){for (int i = 1; i <= 102; i++) for (int j = 1; j <= 102; j++) b[i][j]=0;};
};

matrix mult(matrix x,matrix y)
{
    matrix w=matrix();
    for (int i = 1; i <= 102; i++)
        for (int j = 1; j <= 102; j++)
        {
            ll q=0;
            for (int u = 1; u <= 102; u++)
            {
                q=(q+x.b[i][u]*y.b[u][j]%MOD)%MOD;
                if (q<0) q+=MOD;
            }
            w.b[i][j]=q;
        }
    return w;
}

matrix bnpow(matrix h,ll r)
{
    matrix l=h;
    r--;
    while (r)
    {
        if (r&1) l=mult(l,h);
        h=mult(h,h);
        r/=2;
    }
    return l;
}

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //freopen("capitals.in","r",stdin);
    //freopen("capitals.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> m;
    if (m==0)
    {
        cout << "1\n";
        exit(0);
    }
    matrix w = matrix(), q = matrix();
    for (int i = 2; i <= 105; i++) w.b[i-1][i]=1;
    w.b[1][1]=1;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        w.b[a[i]][1]++;
        w.b[a[i]+1][1]--;
    }
    q.b[1][1]=1;
    w=bnpow(w,m);

    q=mult(q,w);
    cout << q.b[1][1] << "\n";
    return 0;
}

/*
7 6
2 1 1
3 1 2
1 4 0
4 5 1
5 6 3
5 7 4
1 3
4 1
2 4
2 5
3 5
3 7
*/


#include <bits/stdc++.h>
#include <random>
#include <ctime>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("avx2")
#define ll long long
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define pll pair<ll,ll>
#define ld long double
#define pld pair<ld,ld>
#define pii pair<int,int>
#define sqr(a) ((a)*(a))
#define all(v) v.begin(),v.end()

using namespace std;
//using namespace __gnu_pbds;

const ll MOD = 1e9+7;
const ll INF=1e18;
const ld E=1e-8;
mt19937_64 rnd(time(0));
ll p1 = 31, p2 = 29, p3 = 7, p4=rnd()%100+1, md1 = MOD, md2 = 998244353, md3=998244357, md4=rnd()%1000000000;

//using ord_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

ll n, m, k, h, T, q, a[1000001];

ll binpow(ll h, ll r, ll md = MOD)
{
    ll l = 1;
    while (r)
    {
        if (r & 1) l *= h, l %= md;
        h *= h;
        h %= md;
        r /= 2;
    }
    return l;
}

ll gcd(ll x, ll y)
{
    if (x < y) swap(x, y);
    while (x && y)
    {
        x %= y;
        swap(x, y);
    }
    return x + y;
}

struct matrix
{
    ll b[110][110];

    matrix(){for (int i = 1; i <= 102; i++) for (int j = 1; j <= 102; j++) b[i][j]=0;};
};

matrix mult(matrix x,matrix y)
{
    matrix w=matrix();
    for (int i = 1; i <= 102; i++)
        for (int j = 1; j <= 102; j++)
        {
            ll q=0;
            for (int u = 1; u <= 102; u++) q=(q+x.b[i][u]*y.b[u][j])%MOD;
            w.b[i][j]=q;
        }
    return w;
}

matrix bnpow(matrix h,ll r)
{
    matrix l=h;
    r--;
    while (r)
    {
        if (r&1) l=mult(l,h);
        h=mult(h,h);
        r/=2;
    }
    return l;
}

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //freopen("capitals.in","r",stdin);
    //freopen("capitals.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> m;
    if (m==0)
    {
        cout << "1\n";
        exit(0);
    }
    matrix w = matrix(), q = matrix();
    for (int i = 2; i <= 105; i++) w.b[i-1][i]=1;
    w.b[1][1]=1;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        w.b[a[i]][1]++;
        w.b[a[i]+1][1]--;
    }
    q.b[1][1]=1;
    w=bnpow(w,m);

    q=mult(q,w);
    cout << q.b[1][1] << "\n";
    return 0;
}

/*
7 6
2 1 1
3 1 2
1 4 0
4 5 1
5 6 3
5 7 4
1 3
4 1
2 4
2 5
3 5
3 7
*/


//.-. .. ... .
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define pi pair<ll,ll>
#define ppi pair<pair<ll,ll>,ll>
#define pii pair<ll,pair<ll,ll>>
#define fio() ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
const ll inf = 1e9;
const ll mod = 1e9+7;
const ll zero = 0;
const ll maxn = 101;
using namespace std;

typedef int mat[maxn][maxn];

mat a, b, c, bas;
ll cof[maxn - 1], dp[maxn - 1], ps[maxn - 1];

void print(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++)
			cout << a[i][j] << " ";
		cout << endl;
	}
}
void __iden(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = (i == j) ? 1 : 0;
}

void __init(mat a, int d = 0, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = d;
}

void __trans(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			if (j == maxn - 1)
				a[i][j] = (i == maxn - 1) ? 1 : 0;
			else if (i >= (maxn - 2))
				a[i][j] = cof[(maxn - 2) - j];
			else
				a[i][j] = (i == (j - 1)) ? 1 : 0;
		}
	}
}

void __base(mat a, int n = maxn, int m = 1) {
	for (int i = 0; i < (n - 1); i++)
		a[i][0] = dp[i];
	a[n - 1][0] = ps[maxn - 1];
}

void add(mat a, int d, int n = maxn, int m = maxn) {
	d %= mod;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = (a[i][j] + d) % mod;
}

void mul(mat a, mat b, mat c, int n1 = maxn, int m1 = maxn, int n2 = maxn, int m2 = maxn) {
	__init(c);
	for (int i = 0; i < n1; i++)
		for (int j = 0; j < m1; j++)
			for (int k = 0; k < m2; k++) {
				c[i][k] = (c[i][k] + a[i][j] * b[j][k]) % mod;
				if (c[i][k] < mod)
					c[i][k] += mod;
			}
}

void pow(mat a, mat b, mat c, int k, int n = maxn) {
	// answer is saved in b - don't use function recursive (copy in main)
	__init(c, n, n);
	__iden(b, n, n);
	for ( ; k; k /= 2) {
		if (k & 1) {
			mul(a, b, c);
			swap(b, c);
		}
		mul(a, a, c);
		swap(a, c);
	}
}

ll n, x;
ll d[maxn - 1];

int32_t main() {
	//fio();
	scanf("%lld%lld", &n, &x);
	for (int i = 0; i < n; i++) {
		scanf("%lld", & d[i]);
		cof[d[i] - 1]++;
	}
	dp[0] = ps[0] = 1;
	for (int i = 1; i <= 100; i++) {
		for (int j = 0; j < i; j++) {
			dp[i] = (dp[i] + (dp[j] * cof[i - j - 1])) % mod;
			ps[i] = (ps[i - 1] + dp[i]) % mod;
		}
	}
	__base(bas);
	/*for (int i = 0; i <= x; i++) {
		printf("%lld %lld\n", dp[i], ps[i]);
	}*/
	if (x <= 100) {
		printf("%lld\n", ps[x]);
		return 0;
	}
	x -= 100;
	__trans(a);
	__init(c, maxn, maxn);
	__iden(b, maxn, maxn);
	for ( ; x; x /= 2) {
		if (x & 1) {
			mul(a, b, c);
			swap(b, c);
		}
		mul(a, a, c);
		swap(a, c);
	}
	swap(a, b);
	__init(c);
	mul(a, bas, c);
	//print(c, maxn, 1);
	printf("%lld\n", c[maxn - 1][0]);
	return 0;
}


//.-. .. ... .
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define pi pair<ll,ll>
#define ppi pair<pair<ll,ll>,ll>
#define pii pair<ll,pair<ll,ll>>
#define fio() ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
const ll inf = 1e9;
const ll mod = 1e9+7;
const ll zero = 0;
const ll maxn = 101;
using namespace std;

typedef int mat[maxn][maxn];

mat a, b, c, bas;
ll cof[maxn];

void print(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++)
			cout << a[i][j] << " ";
		cout << endl;
	}
}
void __iden(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = (i == j) ? 1 : 0;
}

void __init(mat a, int d = 0, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = d;
}

void __trans(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			if (j == maxn - 1)
				a[i][j] = (i == maxn - 1) ? 1 : 0;
			else if (i >= (maxn - 2))
				a[i][j] = cof[(maxn - 2) - j];
			else
				a[i][j] = (i == (j - 1)) ? 1 : 0;
		}
	}
}

void add(mat a, int d, int n = maxn, int m = maxn) {
	d %= mod;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = (a[i][j] + d) % mod;
}

void mul(mat a, mat b, mat c, int n1 = maxn, int m1 = maxn, int n2 = maxn, int m2 = maxn) {
	__init(c);
	for (int i = 0; i < n1; i++)
		for (int j = 0; j < m1; j++)
			for (int k = 0; k < m2; k++) {
				c[i][k] = (c[i][k] + (((a[i][j] ) * (b[j][k] % mod)))) % mod;
				if (c[i][k] < 0)
					c[i][k] += mod;
			}
}

void pow(mat a, mat b, mat c, int k, int n = maxn) {
	// answer is saved in b - don't use function recursive (copy in main)
	__init(c, n, n);
	__iden(b, n, n);
	for ( ; k; k /= 2) {
		if (k & 1) {
			mul(a, b, c);
			swap(b, c);
		}
		mul(a, a, c);
		swap(a, c);
	}
}

ll n, x;
ll d[maxn - 1];

int main() {
	fio();
	cin >> n >> x;
	if (x == 0) {
		cout << 1 << endl;
		return 0;
	}
	__init(a);
	__init(bas);
	__iden(b);
	__init(c);
	for (int i = 0; i < n; i++) {
		cin >> d[i];
		a[maxn - 1][(maxn - 1) - d[i]]++;
		a[maxn - 2][(maxn - 1) - d[i]]++;
	}
	a[maxn - 1][maxn - 1] = 1;
	bas[maxn - 1][0] = bas[maxn - 2][0] = 1;
	for (int i = 1; i < maxn - 1; i++)
		a[i - 1][i] = 1;
	for ( ; x; x /= 2) {
		if (x & 1) {
			mul(a, b, c);
			swap(b, c);
		}
		mul(a, a, c);
		swap(a, c);
	}
	swap(a, b);
	mul(a, bas, c, maxn, maxn, maxn, 1);
	//print(bas, maxn, 1);
	cout << c[maxn - 1][0] << endl;
	return 0;
}


//.-. .. ... .
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define pi pair<ll,ll>
#define ppi pair<pair<ll,ll>,ll>
#define pii pair<ll,pair<ll,ll>>
#define fio() ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
const ll inf = 1e9;
const ll mod = 1e9+7;
const ll zero = 0;
const ll maxn = 101;
using namespace std;

typedef int mat[maxn][maxn];

mat a, b, c, bas;
ll cof[100009];

void print(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++)
			cout << a[i][j] << " ";
		cout << endl;
	}
}
void __iden(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = (i == j) ? 1 : 0;
}

void __init(mat a, int d = 0, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = d;
}

void __trans(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			if (j == maxn - 1)
				a[i][j] = (i == maxn - 1) ? 1 : 0;
			else if (i >= (maxn - 2))
				a[i][j] = cof[(maxn - 2) - j];
			else
				a[i][j] = (i == (j - 1)) ? 1 : 0;
		}
	}
}

void add(mat a, int d, int n = maxn, int m = maxn) {
	d %= mod;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = (a[i][j] + d) % mod;
}

void mul(mat a, mat b, mat c, int n1 = maxn, int m1 = maxn, int n2 = maxn, int m2 = maxn) {
	__init(c);
	for (int i = 0; i < n1; i++)
		for (int j = 0; j < m1; j++)
			for (int k = 0; k < m2; k++) {
				c[i][k] = (c[i][k] + (((a[i][j] ) * (b[j][k] % mod)))) % mod;
				if (c[i][k] < 0)
					c[i][k] += mod;
			}
}

void pow(mat a, mat b, mat c, int k, int n = maxn) {
	// answer is saved in b - don't use function recursive (copy in main)
	__init(c, n, n);
	__iden(b, n, n);
	for ( ; k; k /= 2) {
		if (k & 1) {
			mul(a, b, c);
			swap(b, c);
		}
		mul(a, a, c);
		swap(a, c);
	}
}

ll n, x;
ll d[100009];

int main() {
	fio();
	cin >> n >> x;
	if (x == 0) {
		cout << 1 << endl;
		return 0;
	}
	__init(a);
	__init(bas);
	__iden(b);
	__init(c);
	for (int i = 0; i < n; i++) {
		cin >> d[i];
		a[maxn - 1][(maxn - 1) - d[i]]++;
		a[maxn - 2][(maxn - 1) - d[i]]++;
	}
	a[maxn - 1][maxn - 1] = 1;
	bas[maxn - 1][0] = bas[maxn - 2][0] = 1;
	for (int i = 1; i < maxn - 1; i++)
		a[i - 1][i] = 1;
	for ( ; x; x /= 2) {
		if (x & 1) {
			mul(a, b, c);
			swap(b, c);
		}
		mul(a, a, c);
		swap(a, c);
	}
	swap(a, b);
	mul(a, bas, c, maxn, maxn, maxn, 1);
	//print(bas, maxn, 1);
	cout << c[maxn - 1][0] << endl;
	return 0;
}


//.-. .. ... .
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define pi pair<ll,ll>
#define ppi pair<pair<ll,ll>,ll>
#define pii pair<ll,pair<ll,ll>>
#define fio() ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
const ll inf = 1e9;
const ll mod = 1e9+7;
const ll zero = 0;
const ll maxn = 101;
using namespace std;

typedef int mat[maxn][maxn];

mat a, b, c, bas;
ll cof[maxn - 1], dp[maxn - 1], ps[maxn - 1];

void print(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++)
			cout << a[i][j] << " ";
		cout << endl;
	}
}
void __iden(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = (i == j) ? 1 : 0;
}

void __init(mat a, int d = 0, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = d;
}

void __trans(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			if (j == maxn - 1)
				a[i][j] = (i == maxn - 1) ? 1 : 0;
			else if (i >= (maxn - 2))
				a[i][j] = cof[(maxn - 2) - j];
			else
				a[i][j] = (i == (j - 1)) ? 1 : 0;
		}
	}
}

void __base(mat a, int n = maxn, int m = 1) {
	for (int i = 0; i < (n - 1); i++)
		a[i][0] = dp[i];
	a[n - 1][0] = ps[maxn - 1];
}

void add(mat a, int d, int n = maxn, int m = maxn) {
	d %= mod;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = (a[i][j] + d) % mod;
}

void mul(mat a, mat b, mat c, int n1 = maxn, int m1 = maxn, int n2 = maxn, int m2 = maxn) {
	__init(c);
	for (int i = 0; i < n1; i++)
		for (int j = 0; j < m1; j++)
			for (int k = 0; k < m2; k++) {
				c[i][k] = (c[i][k] + (((a[i][j] % mod) * (b[j][k] % mod)) % mod)) % mod;
				if (c[i][k] < 0)
					c[i][k] += mod;
			}
}

void pow(mat a, mat b, mat c, int k, int n = maxn) {
	// answer is saved in b - don't use function recursive (copy in main)
	__init(c, n, n);
	__iden(b, n, n);
	for ( ; k; k /= 2) {
		if (k & 1) {
			mul(a, b, c);
			swap(b, c);
		}
		mul(a, a, c);
		swap(a, c);
	}
}

ll n, x;
ll d[maxn - 1];

int32_t main() {
	//fio();
	scanf("%d%d", &n, &x);
	if (x == 0) {
		printf("1\n");
		return 0;
	}
	__init(a);
	__init(bas);
	__iden(b);
	__init(c);
	for (int i = 0; i < n; i++) {
		scanf("%d", &d[i]);
		a[maxn - 1][(maxn - 1) - d[i]]++;
		a[maxn - 2][(maxn - 1) - d[i]]++;
	}
	a[maxn - 1][maxn - 1] = 1;
	bas[maxn - 1][0] = bas[maxn - 2][0] = 1;
	for (int i = 1; i < maxn - 1; i++)
		a[i - 1][i] = 1;
	for ( ; x; x /= 2) {
		if (x & 1) {
			mul(a, b, c);
			swap(b, c);
		}
		mul(a, a, c);
		swap(a, c);
	}
	swap(a, b);
	mul(a, bas, c, maxn, maxn, maxn, 1);
	//print(bas, maxn, 1);
	printf("%lld\n", c[maxn - 1][0]);
	return 0;
}


// R. I. S. E
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pi;
typedef pair<pi, ll> ppi;

const ll maxn = 100;
const ll inf = 1e15;
const ll mod = 1e9 + 7;
const ld eps = 1e-6;

typedef int mat[maxn + 1][maxn + 1];

mat a, b, c;
ll n, x, k;
ll arr[100005], dp[100005], ps[100005], cof[100005];

void __init(mat a, int d = 0) {
	for (int i = 0; i < maxn; i++)
		for (int j = 0; j < maxn; j++)
			a[i][j] = d;
}

void __iden(mat a) {
	for (int i = 0; i < maxn; i++)
		for (int j = 0; j < maxn; j++)
			a[i][j] = 0 + (i == j);
}

void __trans(mat a) {
	for (int i = 0; i < maxn + 1; i++)
		for (int j = 0; j < maxn + 1; j++) {
			if (j == maxn)  {
				if (i == maxn)
					a[i][j] = 1;
				else
					a[i][j] = 0;
			}
			else {
				if (i == 0 || i == maxn) {
					a[i][j] = cof[j];
				} else {
					if (i - 1 == j)
						a[i][j] = 1;
					else
						a[i][j] = 0;
				}
			}
		}

}

void __make(mat a) {
	for (int i = 0; i < maxn + 1; i++)
		a[i][0] = (i == maxn) ? ps[100] : dp[i];
}

void print(mat a, int s = maxn) {
	for (int i = 0; i < s; i++) {
		for (int j = 0; j < s; j++)
			cout << a[i][j] << " ";
		cout << endl;
	}
}

void add(mat a, int d = 1) {
	for (int i = 0; i < maxn; i++)
		for (int j = 0; j < maxn; j++)
			a[i][j] += d;
}

void mul(mat a, mat b, mat c, ll na = maxn, ll ma = maxn, ll nb = maxn, ll mb = maxn) {
	if (nb != ma)
		return;
	__init(c);
	for (int i = 0; i < na; i++)
		for (int j = 0; j < ma; j++)
			for (int k = 0; k < nb; k++)
				c[i][k] += a[i][j] * b[j][k];
}

void pow(mat a, mat b, mat c, int k) {
	//don't use this function; the final answer is not b
	__iden(b);
	__init(c);
	for ( ; k; k /= 2) {
		if (k & 1) {
			mul(a, b, c);
			swap(b, c);
		}
		mul(a, a, c);
		swap(a, c);
	}
}

int main() {
	//ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	scanf("%lld%lld", &n, &x);
	for (int i = 0; i < n; i++) {
		scanf("%lld", &arr[i]);
		cof[arr[i] - 1]++;
	}
	dp[0] = ps[0] = 1;
	dp[1] = cof[0];
	ps[1] = dp[1] + dp[0];
	for (int i = 2; i <= 100; i++) {
		for (int j = 0; j < i; j++)
			dp[i] = (dp[i] + dp[j] * cof[i - j - 1]) % mod;
		ps[i] = (ps[i - 1] + dp[i]) % mod;
	}
	/*for (int i = 0; i <= n; i++)
		printf("%lld ", dp[i]);
	cout << endl;*/
	if (n <= 100) {
		printf("%lld\n", ps[n]);
		return 0;
	}
	k = n - 100;
	__trans(a);
	__iden(b);
	__init(c);
	for ( ; k; k /= 2) {
		if (k & 1) {
			mul(a, b, c, maxn + 1, maxn + 1, maxn + 1, maxn + 1);
			swap(b, c);
		}
		mul(a, a, c, maxn + 1, maxn + 1, maxn + 1, maxn + 1);
		swap(a, c);
	}
	__make(a);
	mul(b, a, c, maxn + 1, maxn + 1, maxn + 1, 1);
	printf("%lld\n", c[maxn][0]);
	return 0;
}


//.-. .. ... .
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define pi pair<ll,ll>
#define ppi pair<pair<ll,ll>,ll>
#define pii pair<ll,pair<ll,ll>>
#define fio() ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
const ll inf = 1e9;
const ll mod = 1e9+7;
const ll zero = 0;
const ll maxn = 101;
using namespace std;

typedef int mat[maxn][maxn];

mat a, b, c, bas;
ll cof[100009];

void print(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++)
			cout << a[i][j] << " ";
		cout << endl;
	}
}
void __iden(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = (i == j) ? 1 : 0;
}

void __init(mat a, int d = 0, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = d;
}

void __trans(mat a, int n = maxn, int m = maxn) {
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			if (j == maxn - 1)
				a[i][j] = (i == maxn - 1) ? 1 : 0;
			else if (i >= (maxn - 2))
				a[i][j] = cof[(maxn - 2) - j];
			else
				a[i][j] = (i == (j - 1)) ? 1 : 0;
		}
	}
}

void add(mat a, int d, int n = maxn, int m = maxn) {
	d %= mod;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			a[i][j] = (a[i][j] + d) % mod;
}

void mul(mat a, mat b, mat c, int n1 = maxn, int m1 = maxn, int n2 = maxn, int m2 = maxn) {
	__init(c);
	for (int i = 0; i < n1; i++)
		for (int j = 0; j < m1; j++)
			for (int k = 0; k < m2; k++) {
				c[i][k] = (c[i][k] + (((a[i][j] ) * (b[j][k] % mod)))) % mod;
				if (c[i][k] < 0)
					c[i][k] += mod;
			}
}

void pow(mat a, mat b, mat c, int k, int n = maxn) {
	// answer is saved in b - don't use function recursive (copy in main)
	__init(c, n, n);
	__iden(b, n, n);
	for ( ; k; k /= 2) {
		if (k & 1) {
			mul(a, b, c);
			swap(b, c);
		}
		mul(a, a, c);
		swap(a, c);
	}
}

ll n, x;
ll d[100009];

int main() {
	scanf("%lld %lld", &n, &x);
	__init(a);
	__init(bas);
	__iden(b);
	__init(c);
	for (int i = 0; i < n; i++) {
		scanf("%lld", &d[i]);
		a[maxn - 1][(maxn - 1) - d[i]]++;
		a[maxn - 2][(maxn - 1) - d[i]]++;
	}
	a[maxn - 1][maxn - 1] = 1;
	bas[maxn - 1][0] = bas[maxn - 2][0] = 1;
	for (int i = 1; i < maxn - 1; i++)
		a[i - 1][i] = 1;
	for ( ; x; x /= 2) {
		if (x & 1) {
			mul(a, b, c);
			swap(b, c);
		}
		mul(a, a, c);
		swap(a, c);
	}
	swap(a, b);
	mul(a, bas, c, maxn, maxn, maxn, 1);
	//print(bas, maxn, 1);
	printf("%lld\n", c[maxn - 1][0]);
	return 0;
}