#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
long long LCM(long long a, long long b) { return a * (b / GCD(a, b)); }
const double EPS = 10e-9;
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> a(N, 0);
  for (int i = 0; i < (N); ++i) {
    cin >> a[i];
  }
  sort((a).begin(), (a).end());
  sort((a).begin(), (a).end()),
      (a).erase(unique((a).begin(), (a).end()), (a).end());
  if (a[0] == 1) {
    cout << M << endl;
  } else {
    long long lcm = 1L;
    for (int j = 0; j < (a.size()); ++j) {
      lcm = LCM(lcm, a[j] - 1);
    }
    for (int j = 0; j < (a.size()); ++j) {
      lcm = GCD(lcm, a[j] - 1);
    }
    while (lcm % 2 == 0) lcm /= 2;
    long long total = 0;
    for (long long i = 1LL; i * i <= lcm; i++) {
      if (lcm % i == 0) {
        long long I = i, J = lcm / i;
        do {
          total += max(M - I, 0LL);
          I *= 2LL;
        } while (I <= M);
        if (i < lcm / i) {
          do {
            total += max(M - J, 0LL);
            J *= 2LL;
          } while (J <= M);
        }
      }
    }
    cout << total << endl;
  }
  return 0;
}
