#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
int n, m;
int a[1 << 17];
int gcd(int x, int y) { return y == 0 ? x : gcd(y, x % y); }
long long get(int d) {
  long long res = 0;
  for (int i = 0; i <= 30; ++i) {
    long long v = (long long)d * (1 << i);
    res += max(0LL, m - v);
  }
  return res;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  int d = a[0] - 1;
  for (int i = 1; i < n; ++i) d = gcd(d, a[i] - 1);
  long long res = 0;
  for (int i = 1; i * i <= d; ++i) {
    if (d % i == 0) {
      if (i & 1) res += get(i);
    }
    if (i != d / i && d % (d / i) == 0) {
      if ((d / i) & 1) res += get(d / i);
    }
  }
  printf("%I64d\n", res);
  return 0;
}
