#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
int main() {
  int n, m, t, a[100005], b[100005], cd;
  long long ans;
  cd = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> t;
    a[i] = t - 1;
  }
  for (int i = 0; i < n; i++) {
    while ((a[i] % 2) == 0) {
      a[i] = (a[i] / 2);
    }
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    cd = gcd(cd, a[i]);
  }
  ans = 0;
  int k = 0;
  for (int i = 1; i * i <= cd; i += 2) {
    int x = 1;
    if ((cd % i) != 0) {
      x = 0;
    }
    if (x == 1) {
      if ((i * i) != cd) {
        b[k++] = i;
        b[k++] = (cd / i);
      } else {
        b[k++] = i;
      }
    }
  }
  for (int i = 0; i < k; i++) {
    for (int j = b[i]; j <= m; j = 2 * j) {
      ans = ans + (m - j);
    }
  }
  cout << ans;
  return 0;
}
