#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int n, m;
vector<int> fac;
int main() {
  cin >> n >> m;
  int t = 0;
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    t = gcd(num - 1, t);
  }
  for (int i = 1; i * i <= t; i++) {
    if (t % i == 0) {
      fac.push_back(i);
      if (i * i != t) fac.push_back(t / i);
    }
  }
  long long ans = 0;
  for (int i = 0; i < fac.size(); i++) {
    int t = fac[i];
    if (t & 1) {
      for (int j = t; j <= m; j *= 2) ans += m - j;
    }
  }
  cout << ans << endl;
  return 0;
}
