#include <bits/stdc++.h>
using namespace std;
void open() { freopen("data.txt", "r", stdin); }
void out() { freopen("out.txt", "w", stdout); }
const int maxn = 1e6 + 5;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
int divis[maxn], tot, n, m, g, x;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
void getdivis(int x) {
  int i;
  for (i = 1; i * i < x; i++) {
    if (x % i) continue;
    divis[++tot] = i;
    divis[++tot] = x / i;
  }
  if (i * i == x) divis[++tot] = i;
}
int main() {
  long long ans = 0;
  scanf("%d%d", &n, &m);
  for (int i = 1; i < (n + 1); ++i) {
    scanf("%d", &x);
    g = gcd(g, x - 1);
  }
  getdivis(g);
  for (int i = 1; i < (tot + 1); ++i) {
    if (divis[i] & 1) {
      for (int j = divis[i]; j <= m; j <<= 1) ans += m - j;
    }
  }
  cout << ans << endl;
}
