#include <bits/stdc++.h>
int n, m, x, a;
long long ans;
void read(int &x) {
  char c;
  for (c = getchar(); c < '0' || c > '9'; c = getchar())
    ;
  x = c - 48;
  for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - 48;
}
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
void work(long long x) {
  while (x < m) {
    ans += m - x, x *= 2;
  }
}
int main() {
  read(n), read(m);
  read(x), x--;
  for (int i = 2; i <= n; i++) {
    read(a);
    x = gcd(x, a - 1);
    if (x == 1) break;
  }
  for (int i = 1; i * i <= x; i++)
    if (x % i == 0) {
      int t = x / i;
      if (i % 2 != 0) work(i);
      if (t != i && t % 2 != 0) work(t);
    }
  printf("%I64d\n", ans);
  getchar(), getchar();
}
