#include <bits/stdc++.h>
using namespace std;
const int inf = 987654321;
const long long int INF = 123456789987654321;
int N, M;
vector<int> arr, d;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  scanf("%d %d", &N, &M);
  arr.resize(N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &arr[i]);
  }
  int cnt = 0;
  for (int i = 0; i < N; i++) {
    if (arr[i] == 1) cnt++;
  }
  if (cnt == N) {
    printf("%d", M);
    return 0;
  }
  if (cnt) {
    printf("0");
    return 0;
  }
  int g = arr[0] - 1;
  for (int i = 1; i < N; i++) {
    g = gcd(g, arr[i] - 1);
  }
  while (g % 2 == 0) g /= 2;
  if (g == 0) {
    printf("%d", M);
    return 0;
  }
  for (int i = 1; i <= sqrt(g); i++) {
    if (g % i == 0) {
      d.push_back(i);
      if (i * i != g) d.push_back(g / i);
    }
  }
  long long int ans = 0;
  for (int i = 0; i < d.size(); i++) {
    for (int j = 0; j < 30; j++) {
      if (d[i] * (1 << j) > M) break;
      ans += (long long int)(M - d[i] * (1 << j));
    }
  }
  printf("%I64d", ans);
}
