#include <bits/stdc++.h>
using namespace std;
int MODP(long long x) {
  int r = x % 1000000007;
  if (r < 0) r += 1000000007;
  return r;
}
template <class T>
class Matrix {
  vector<vector<T>> a;
  int nRow, nCol;

 public:
  void init(int nRow, int nCol) {
    this->nRow = nRow;
    this->nCol = nCol;
    a.resize(nRow);
    for (auto r = 0; r < nRow; ++r) {
      a[r].resize(nCol);
      for (auto c = 0; c < nCol; ++c) {
        a[r][c] = 0;
      }
    }
  }
  void init(int nRow, int nCol, const vector<vector<T>> &val) {
    assert(val.size() == nRow);
    assert(val[0].size() == nCol);
    init(nRow, nCol);
    for (auto r = 0; r < nRow; ++r) {
      for (auto c = 0; c < nCol; ++c) {
        a[r][c] = val[r][c];
      }
    }
  }
  void init(const vector<vector<T>> &val) {
    init((int)val.size(), (int)val[0].size(), val);
  }
  Matrix &operator=(const vector<vector<T>> &val) {
    init(val);
    return *this;
  }
  Matrix operator+(const Matrix &o) const {
    assert(nRow == o.nRow);
    assert(nCol == o.nCol);
    Matrix ret;
    ret.init(nRow, nCol);
    for (auto r = 0; r < nRow; ++r)
      for (auto c = 0; c < nCol; ++c) ret.a[r][c] = a[r][c] + o.a[r][c];
    return ret;
  }
  Matrix operator*(const Matrix &o) const {
    assert(nCol == o.nRow);
    Matrix ret;
    ret.init(nRow, o.nCol);
    for (auto r = 0; r < nRow; ++r)
      for (auto c2 = 0; c2 < nCol; ++c2)
        if (a[r][c2] != 0)
          for (auto c = 0; c < o.nCol; ++c) {
            ret.a[r][c] += a[r][c2] * o.a[c2][c];
          }
    return ret;
  }
  Matrix power(int k) const {
    assert(k >= 0);
    assert(nRow == nCol);
    if (k == 0) {
      Matrix ret;
      ret.init(nRow, nRow);
      for (auto r = 0; r < nRow; ++r) ret.a[r][r] = 1;
      return ret;
    } else if (k % 2 == 0) {
      Matrix tmp = power(k / 2);
      return tmp * tmp;
    } else {
      Matrix tmp = power(k - 1);
      return *this * tmp;
    }
  }
  vector<T> &operator[](int r) { return a[r]; }
  friend std::ostream &operator<<(std::ostream &stream, const Matrix &matrix) {
    stream << "[matrix: row = " << matrix.nRow << ", col = " << matrix.nCol
           << endl;
    for (auto r = 0; r < matrix.nRow; ++r) {
      for (auto c = 0; c < matrix.nCol; ++c) {
        stream << matrix.a[r][c] << " ";
      }
      stream << endl;
    }
    stream << "]" << endl;
    return stream;
  }
};
template <class T>
class NumberTheory {
  static void extendedEuclid(T a, T b, T &x, T &y) {
    if (b == 0) {
      x = 1;
      y = 0;
      return;
    }
    T x2;
    extendedEuclid(b, a % b, x2, x);
    y = x2 - (a / b) * x;
  }

 public:
  static inline T modulo(long long a, T b) {
    T r = a % b;
    if (r < 0) r += b;
    return r;
  }
  static inline T modularInverse(T a, T m) {
    T x, y;
    extendedEuclid(a, m, x, y);
    return modulo(x, m);
  }
};
template <class T, T M>
class ModInt {
  T x = 0;
  static inline T get(ModInt x) { return x.get(); }
  static inline T get(T x) { return x; }

 public:
  ModInt() : ModInt(0) {}
  ModInt(long long y) { x = NumberTheory<T>::modulo(y, M); }
  T get() const { return x; }
  template <class Q>
  ModInt operator+(const Q &y) const {
    return ModInt(x + get(y));
  }
  template <class Q>
  ModInt &operator+=(const Q &y) {
    x = NumberTheory<T>::modulo(x + get(y), M);
    return *this;
  }
  template <class Q>
  ModInt operator-(const Q &y) const {
    return ModInt(x - get(y));
  }
  template <class Q>
  bool operator!=(const Q &y) const {
    return x != get(y);
  }
  template <class Q>
  ModInt operator*(const Q &y) const {
    return ModInt((long long)x * get(y));
  }
  template <class Q>
  ModInt operator/(const Q &y) const {
    return ModInt((long long)x *
                  NumberTheory<T>::modularInverse(get(y), 1000000007));
  }
  ModInt &operator=(const T &y) {
    x = NumberTheory<T>::modulo(y, M);
    return *this;
  }
  ModInt &operator=(const ModInt &y) {
    x = y.x;
    return *this;
  }
  friend std::ostream &operator<<(std::ostream &stream, const ModInt &y) {
    stream << get(y);
    return stream;
  }
};
void testGen() {
  freopen("biginput1.txt", "w", stdout);
  fclose(stdout);
}
int n, x;
vector<int> d, cnt;
int main() {
  cin >> n >> x;
  int m = 0;
  d.resize(n);
  for (auto i = 0; i < n; ++i) {
    cin >> d[i];
    m = max(m, d[i]);
  }
  cnt.resize(m + 1);
  for (auto i = 0; i < n; ++i) {
    cnt[d[i]]++;
  }
  Matrix<ModInt<int, 1000000007>> a;
  a.init(m + 1, m + 1);
  a[0][0] = 1;
  for (auto r = 1; r <= m - 1; ++r) {
    a[r][r + 1] = 1;
  }
  a[m][0] = 1;
  for (auto c = 1; c <= m; ++c) {
    a[m][c] = cnt[m - c + 1];
  }
  if (1 <= 0) cout << "Matrix: " << a << endl;
  a = a.power(x);
  if (1 <= 0) cout << "Matrix power: " << x << " " << a << endl;
  cout << (a[m][0] + a[m][m]).get() << endl;
  return 0;
}
