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