#include <bits/stdc++.h>
using namespace std;
vector<long long> divs;
long long g(long long a, long long b) {
  if (a > b) {
    swap(a, b);
  }
  if (a == 0) {
    return b;
  }
  return g(b % a, a);
}
int main() {
  long long n, m, gcd = 1;
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    a--;
    if (i == 0) {
      gcd = a;
    } else {
      gcd = g(gcd, a);
    }
  }
  for (long long i = 1; i * i <= gcd; i++) {
    if (gcd % i) {
      continue;
    }
    divs.push_back(i);
    if (i * i != gcd) {
      divs.push_back(gcd / i);
    }
  }
  for (long long i = 0; i < divs.size(); i++) {
    while (divs[i] % 2 == 0) {
      divs[i] /= 2;
    }
  }
  sort(divs.begin(), divs.end());
  long long ans = 0;
  for (long long i = 0; i < divs.size(); i++) {
    if (i && divs[i] == divs[i - 1]) {
      continue;
    }
    for (long long st = 0; (1LL << st) * divs[i] <= m; st++) {
      long long d = divs[i] * (1LL << st);
      long long cpos = m - d;
      long long ds = d, cntd = 0;
      for (; ds % 2 == 0; cntd++) {
        ds /= 2;
      }
      long long cnt = cntd;
      ds = d / (1 << cnt);
      if (gcd % ds == 0) {
        ans += cpos;
      }
    }
  }
  cout << ans << "\n";
  return 0;
}
