#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, x;
  cin >> n >> x;
  vector<int> a(n);
  for(int i = 0; i < n; i++){
    cin >> a.at(i);
  }
  for(int i = 0; i < n; i++){
    if(x == a.at(i)){
      a.erase(a.begin() + i);
      n--;
      i--;
    }
  }
  for(int i = 0; i < n; i++){
    cout << a.at(i) << " ";
  }
}
#include <algorithm>
#include <bitset>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define INF 0x3f3f3f3f
#define MOD 1000000007

using namespace std;
typedef long long ll;

mt19937 rng(random_device{}());
mt19937_64 rng64(random_device{}());

template <typename T> void read(T &x) {
  x = 0;
  char c = getchar();
  T sig = 1;
  for (; !isdigit(c); c = getchar())
    if (c == '-')
      sig = -1;
  for (; isdigit(c); c = getchar())
    x = (x << 3) + (x << 1) + c - '0';
  x *= sig;
}

class Solution {
public:
  void solve() {
    int n;
    ll x;
    read(n);
    read(x);
    vector<ll> a(n);
    for (int i = 0; i < n; ++i)
      read(a[i]);
    unordered_map<ll, ll> v;
    v[x] = 1;
    ll ans = 0;
    for (int i = 0; i < n; ++i) {
      unordered_map<ll, ll> nv;
      for (auto [c, f] : v) {
        if (c == 0)
          continue;
        if (i + 1 < n) {
          ll rem = c % a[i + 1];
          nv[c - rem] += f;
          if (rem > 0)
            nv[c + a[i + 1] - rem] += f;
        } else {
          if (c % a[i] == 0)
            nv[0] += f;
        }
      }
      v = move(nv);
      ans += v[0];
      v.erase(0);
    }
    cout << ans;
  }
};

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  Solution solution = Solution();
  solution.solve();
}