#include <bits/stdc++.h>
using namespace std;
long long res, n, m;
long long gcd(long long a, long long b) {
  long long t = -1;
  while (t != 0) {
    t = a % b;
    a = b;
    b = t;
  }
  return a;
}
long long sum(long long b) {
  long long temp = b;
  long long r = 0;
  while (temp < m) {
    r += m - temp;
    temp *= 2;
  }
  return r;
}
int main() {
  long long a;
  cin >> n >> m;
  long long g = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    g = gcd(g, a - 1);
  }
  for (long long dif = 1; dif * dif <= g; dif++) {
    if (g % dif == 0) {
      if (dif % 2 == 1) res += sum(dif);
      if (g / dif % 2 == 1 && dif * dif < g) res += sum(g / dif);
    }
  }
  cout << res << endl;
  return 0;
}
