#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
bool isp[N];
int np, p[N], n, m, a[N];
void makePrime() {
  for (int i = 2; i < N; ++i) {
    if (isp[i] == 0) p[np++] = i;
    for (int j = 0; j < np && (long long)i * p[j] < N; ++j) {
      isp[i * p[j]] = 1;
      if (i % p[j] == 0) break;
    }
  }
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
void add(long long &ans, int i) {
  while (i <= m) {
    ans += m - i;
    i *= 2;
  }
}
int main() {
  makePrime();
  vector<int> v;
  scanf("%d%d", &n, &m);
  int i;
  for (i = 0; i < (int)(n); ++i) scanf("%d", &a[i]);
  int d = a[0] - 1;
  for (i = 0; i < (int)(n); ++i) d = gcd(d, a[i] - 1);
  while (d % 2 == 0) d /= 2;
  long long ans = 0;
  for (i = 1; (long long)i * i <= d; ++i)
    if (d % i == 0) {
      add(ans, i);
      if (i * i == d) break;
      add(ans, d / i);
    }
  cout << ans << endl;
  return 0;
}
