#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define maxn 105
#define mod 1000000007
ll n, k, i, j, x, res, tmp, ans;
ll freq[maxn];
struct matran
{
ll a[101][101];
void print()
{
for (ll i = 0; i < 101; i++)
{
for (ll j = 0; j < 101; j++)
cout << a[i][j] << " ";
cout << '\n';
}
}
};
struct matran_1
{
ll a[1][101];
void print()
{
for (ll i = 0; i < 1; i++)
{
for (ll j = 0; j < 101; j++)
cout << a[i][j] << " ";
cout << '\n';
}
}
};
matran mot, M;
matran_1 init, ress;
matran prod(matran A, matran B)
{
matran C;
for (ll i = 0; i < 101; i++)
for (ll j = 0; j < 101; j++)
C.a[i][j] = 0;
for (ll i = 0; i < 101; i++)
for (ll j = 0; j < 101; j++)
for (ll k = 0; k < 101; k++)
C.a[i][j] = (C.a[i][j] + A.a[i][k] % mod * B.a[k][j] % mod) % mod;
return C;
}
matran_1 prod1(matran_1 A, matran B)
{
matran_1 C;
for (ll i = 0; i < 1; i++)
for (ll j = 0; j < 101; j++)
C.a[i][j] = 0;
for (ll i = 0; i < 1; i++)
for (ll j = 0; j < 101; j++)
for (ll k = 0; k < 101; k++)
C.a[i][j] = (C.a[i][j] + A.a[i][k] % mod * B.a[k][j] % mod) % mod;
return C;
}
matran po(matran A, ll n)
{
matran res = A, ans = mot;
while (n)
{
if (n % 2)
ans = prod(ans, res);
res = prod(res, res);
n /= 2;
}
return ans;
}
int main()
{
cin >> n >> k;
for (i = 0; i < n; i++)
{
cin >> x;
freq[x]++;
}
for (ll i = 0; i < 101; i++)
for (ll j = 0; j < 101; j++)
if (i == j)
mot.a[i][j] = 1;
else
mot.a[i][j] = 0;
for (ll i = 0; i < 101; i++)
for (ll j = 0; j < 101; j++)
{
if (j == 0 && (i <= 1))
M.a[i][j] = 1;
else if (j == 0 && (i > 1))
M.a[i][j] = 0;
if (j == 1 && i == 0)
M.a[i][j] = 0;
else if (j == 1 && i > 0)
M.a[i][j] = freq[i];
if (j >= 2)
{
if (j - i == 1)
M.a[i][j] = 1;
else
M.a[i][j] = 0;
}
}
for (i = 0; i < 1; i++)
for (j = 0; j < 101; j++)
{
if (j == 0)
init.a[i][j] = 0;
if (j == 1)
init.a[i][j] = 1;
if (j > 1)
init.a[i][j] = 0;
}
ress = prod1(init, po(M, k+1));
cout << ress.a[0][0]<<'\n';
// for(i=1;i<=5;i++) cout<<freq[i]<<" ";
// cout<<'\n';
// init.print();
// cout<<"-----\n";
// M.print();
// cout<<"------\n";
// po(mot,3).print();
// cout<<'\n';
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgbWF4biAxMDUKI2RlZmluZSBtb2QgMTAwMDAwMDAwNwpsbCBuLCBrLCBpLCBqLCB4LCByZXMsIHRtcCwgYW5zOwpsbCBmcmVxW21heG5dOwpzdHJ1Y3QgbWF0cmFuCnsKICAgICAgICBsbCBhWzEwMV1bMTAxXTsKICAgICAgICB2b2lkIHByaW50KCkKICAgICAgICB7CiAgICAgICAgICAgICAgICBmb3IgKGxsIGkgPSAwOyBpIDwgMTAxOyBpKyspCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGwgaiA9IDA7IGogPCAxMDE7IGorKykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3V0IDw8IGFbaV1bal0gPDwgIiAiOwogICAgICAgICAgICAgICAgICAgICAgICBjb3V0IDw8ICdcbic7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgfQp9OwpzdHJ1Y3QgbWF0cmFuXzEKewogICAgICAgIGxsIGFbMV1bMTAxXTsKICAgICAgICB2b2lkIHByaW50KCkKICAgICAgICB7CiAgICAgICAgICAgICAgICBmb3IgKGxsIGkgPSAwOyBpIDwgMTsgaSsrKQogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxsIGogPSAwOyBqIDwgMTAxOyBqKyspCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY291dCA8PCBhW2ldW2pdIDw8ICIgIjsKICAgICAgICAgICAgICAgICAgICAgICAgY291dCA8PCAnXG4nOwogICAgICAgICAgICAgICAgfQogICAgICAgIH0KfTsKbWF0cmFuIG1vdCwgTTsKbWF0cmFuXzEgaW5pdCwgcmVzczsKbWF0cmFuIHByb2QobWF0cmFuIEEsIG1hdHJhbiBCKQp7CiAgICAgICAgbWF0cmFuIEM7CiAgICAgICAgZm9yIChsbCBpID0gMDsgaSA8IDEwMTsgaSsrKQogICAgICAgICAgICAgICAgZm9yIChsbCBqID0gMDsgaiA8IDEwMTsgaisrKQogICAgICAgICAgICAgICAgICAgICAgICBDLmFbaV1bal0gPSAwOwogICAgICAgIGZvciAobGwgaSA9IDA7IGkgPCAxMDE7IGkrKykKICAgICAgICAgICAgICAgIGZvciAobGwgaiA9IDA7IGogPCAxMDE7IGorKykKICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsbCBrID0gMDsgayA8IDEwMTsgaysrKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEMuYVtpXVtqXSA9IChDLmFbaV1bal0gKyBBLmFbaV1ba10gJSBtb2QgKiBCLmFba11bal0gJSBtb2QpICUgbW9kOwogICAgICAgIHJldHVybiBDOwp9Cm1hdHJhbl8xIHByb2QxKG1hdHJhbl8xIEEsIG1hdHJhbiBCKQp7CiAgICAgICAgbWF0cmFuXzEgQzsKICAgICAgICBmb3IgKGxsIGkgPSAwOyBpIDwgMTsgaSsrKQogICAgICAgICAgICAgICAgZm9yIChsbCBqID0gMDsgaiA8IDEwMTsgaisrKQogICAgICAgICAgICAgICAgICAgICAgICBDLmFbaV1bal0gPSAwOwogICAgICAgIGZvciAobGwgaSA9IDA7IGkgPCAxOyBpKyspCiAgICAgICAgICAgICAgICBmb3IgKGxsIGogPSAwOyBqIDwgMTAxOyBqKyspCiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGwgayA9IDA7IGsgPCAxMDE7IGsrKykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDLmFbaV1bal0gPSAoQy5hW2ldW2pdICsgQS5hW2ldW2tdICUgbW9kICogQi5hW2tdW2pdICUgbW9kKSAlIG1vZDsKICAgICAgICByZXR1cm4gQzsKfQptYXRyYW4gcG8obWF0cmFuIEEsIGxsIG4pCnsKICAgICAgICBtYXRyYW4gcmVzID0gQSwgYW5zID0gbW90OwogICAgICAgIHdoaWxlIChuKQogICAgICAgIHsKICAgICAgICAgICAgICAgIGlmIChuICUgMikKICAgICAgICAgICAgICAgICAgICAgICAgYW5zID0gcHJvZChhbnMsIHJlcyk7CiAgICAgICAgICAgICAgICByZXMgPSBwcm9kKHJlcywgcmVzKTsKICAgICAgICAgICAgICAgIG4gLz0gMjsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGFuczsKfQoKaW50IG1haW4oKQp7CiAgICAgIAoKICAgICAgICBjaW4gPj4gbiA+PiBrOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyBpKyspCiAgICAgICAgewogICAgICAgICAgICAgICAgY2luID4+IHg7CiAgICAgICAgICAgICAgICBmcmVxW3hdKys7CiAgICAgICAgfQogICAgICAgIGZvciAobGwgaSA9IDA7IGkgPCAxMDE7IGkrKykKICAgICAgICAgICAgICAgIGZvciAobGwgaiA9IDA7IGogPCAxMDE7IGorKykKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gaikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3QuYVtpXVtqXSA9IDE7CiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3QuYVtpXVtqXSA9IDA7CiAgICAgICAgZm9yIChsbCBpID0gMDsgaSA8IDEwMTsgaSsrKQogICAgICAgICAgICAgICAgZm9yIChsbCBqID0gMDsgaiA8IDEwMTsgaisrKQogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAoaiA9PSAwICYmIChpIDw9IDEpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE0uYVtpXVtqXSA9IDE7CiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGogPT0gMCAmJiAoaSA+IDEpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE0uYVtpXVtqXSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChqID09IDEgJiYgaSA9PSAwKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE0uYVtpXVtqXSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGogPT0gMSAmJiBpID4gMCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNLmFbaV1bal0gPSBmcmVxW2ldOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoaiA+PSAyKQogICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGogLSBpID09IDEpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNLmFbaV1bal0gPSAxOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE0uYVtpXVtqXSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTsgaSsrKQogICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDEwMTsgaisrKQogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAoaiA9PSAwKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXQuYVtpXVtqXSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChqID09IDEpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdC5hW2ldW2pdID0gMTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGogPiAxKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXQuYVtpXVtqXSA9IDA7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgcmVzcyA9IHByb2QxKGluaXQsIHBvKE0sIGsrMSkpOwogICAgICAgIGNvdXQgPDwgcmVzcy5hWzBdWzBdPDwnXG4nOwogICAgICAgIC8vIGZvcihpPTE7aTw9NTtpKyspIGNvdXQ8PGZyZXFbaV08PCIgIjsKICAgICAgICAvLyBjb3V0PDwnXG4nOwogICAgICAgIC8vIGluaXQucHJpbnQoKTsKICAgICAgICAvLyBjb3V0PDwiLS0tLS1cbiI7CiAgICAgICAgLy8gTS5wcmludCgpOwogICAgICAgIC8vIGNvdXQ8PCItLS0tLS1cbiI7CiAgICAgICAgLy8gcG8obW90LDMpLnByaW50KCk7CiAgICAgICAgLy8gY291dDw8J1xuJzsKICAgICAgICByZXR1cm4gMDsKfQ==