#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  }
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
int main() {
  int n;
  long long m;
  cin >> n >> m;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long d = 0, p, q, cnt = 0;
  for (int i = 0; i < n; i++) {
    d = gcd(d, a[i] - 1);
  }
  for (long long i = 1; i * i <= d; i++) {
    if (d % i == 0) {
      p = i;
      q = d / i;
      if (p % 2 == 1) {
        while (p <= m) {
          cnt += m - p;
          p <<= 1;
        }
      }
      if (q % 2 == 1 && q != i) {
        while (q <= m) {
          cnt += m - q;
          q <<= 1;
        }
      }
    }
  }
  cout << cnt << "\n";
}
