#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) { return x ? gcd(y % x, x) : y; }
long long func(long long M, long long g) {
  long long ans = 0;
  while (g < M) {
    ans += M - g;
    g *= 2;
  }
  return ans;
}
int main(void) {
  int N, M, i;
  cin >> N >> M;
  long long g = 0;
  for ((i) = 0; (i) < (int)(N); (i)++) {
    int x;
    scanf("%d", &x);
    g = gcd(g, x - 1);
  }
  long long ans = 0;
  while (g % 2 == 0) g /= 2;
  for (long long d = 1; d * d <= g; d++)
    if (g % d == 0) {
      ans += func(M, d);
      if (g / d > d) ans += func(M, g / d);
    }
  cout << ans << endl;
  return 0;
}
