#include <bits/stdc++.h>
using namespace std;
typedef pair<long long, long long> ll;
typedef vector<long long> vl;
typedef vector<ll> vll;
typedef vector<vl> vvl;
template <typename T>
ostream &operator<<(ostream &o, vector<T> v) {
  if (v.size() > 0) o << v[0];
  for (unsigned i = 1; i < v.size(); i++) o << " " << v[i];
  return o << "\n";
}
template <typename U, typename V>
ostream &operator<<(ostream &o, pair<U, V> p) {
  return o << "(" << p.first << ", " << p.second << ") ";
}
template <typename T>
istream &operator>>(istream &in, vector<T> &v) {
  for (unsigned i = 0; i < v.size(); i++) in >> v[i];
  return in;
}
template <typename T>
istream &operator>>(istream &in, pair<T, T> &p) {
  in >> p.first;
  in >> p.second;
  return in;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  long long n, m;
  cin >> n >> m;
  long long g = 0;
  for (long long i = (0); i < (long long)n; i++) {
    long long x;
    cin >> x;
    g = gcd(g, x - 1);
  }
  set<long long> divisor;
  for (long long i = 1; i * i <= g; i++)
    if (g % i == 0) {
      divisor.insert(i);
      divisor.insert(g / i);
    }
  long long ans = 0;
  vl power(31, 1);
  for (long long i = (1); i < (long long)31; i++) power[i] = power[i - 1] * 2;
  for (auto &it : divisor) {
    if (it % 2 == 0) continue;
    for (long long i = (0); i < (long long)31; i++)
      if (power[i] <= m / it) ans += m - power[i] * it;
  }
  cout << ans;
  return 0;
}
