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