#include <bits/stdc++.h>
using namespace std;
int GCD(int a, int b) {
  while (true) {
    if (a == 0) return b;
    b %= a;
    if (b == 0) return a;
    a %= b;
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  int a, gcd = 0;
  for (; n > 0; --n) {
    cin >> a;
    gcd = GCD(gcd, a - 1);
  }
  while (gcd % 2 == 0) gcd /= 2;
  int sr = sqrt(gcd);
  int exp;
  vector<int> factors;
  factors.push_back(1);
  for (int i = 2; i <= sr; ++i) {
    if (gcd % i) continue;
    exp = 0;
    do {
      gcd /= i;
      ++exp;
    } while (gcd % i == 0);
    sr = sqrt(gcd);
    for (int j = factors.size() - 1; j >= 0; --j) {
      a = factors[j];
      for (int k = 0; k < exp; ++k) {
        factors.push_back(a *= i);
      }
    }
  }
  if (gcd != 1)
    for (int i = factors.size() - 1; i >= 0; --i)
      factors.push_back(factors[i] * gcd);
  long long ans = 0;
  for (int i = factors.size() - 1; i >= 0; --i) {
    for (a = factors[i]; a < m; a *= 2) ans += m - a;
  }
  cout << ans;
  return 0;
}
