#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int number = 3;
int m[] = {1004535809, 1007681537, 1012924417, 998244353, 104857601};
int g[] = {3, 3, 5, 3, 3};
int cur;
long long pw(long long a, int b, int mod) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
long long w[65536];
long long a[65536], b[65536];
void init(int n, int sign) {
  w[0] = 1;
  w[1] = pw(g[cur], (m[cur] - 1) / n, m[cur]);
  if (sign == -1) w[1] = pw(w[1], m[cur] - 2, m[cur]);
  for (int i = 2; i < n; i++) w[i] = w[i - 1] * w[1] % m[cur];
}
int rev(int x, int bit) {
  int res = 0;
  for (int i = 0; i < bit; i++) {
    res = res << 1 | x & 1;
    x >>= 1;
  }
  return res;
}
void FNT(long long *y, int bit) {
  int n = 1 << bit;
  for (int i = 0; i < n; i++) {
    int j = rev(i, bit);
    if (i < j) swap(y[i], y[j]);
  }
  for (int i = 2; i <= n; i <<= 1) {
    int len = i >> 1;
    for (int j = 0; j < n; j += i) {
      for (int k = 0; k < len; k++) {
        long long t = y[j + k + len] * w[n / i * k] % m[cur];
        y[j + k + len] = (y[j + k] - t + m[cur]) % m[cur];
        y[j + k] = (y[j + k] + t) % m[cur];
      }
    }
  }
}
void IFNT(long long *y, int bit) {
  FNT(y, bit);
  int n = 1 << bit;
  long long inv = pw(n, m[cur] - 2, m[cur]);
  for (int i = 0; i < n; i++) y[i] = y[i] * inv % m[cur];
}
void NTT(long long *a, long long *b, int la, int lb) {
  int len = la + lb - 1;
  int n = 1, bit = 0;
  while (n < len) n <<= 1, bit++;
  for (int i = la; i < n; i++) a[i] = 0;
  for (int i = lb; i < n; i++) b[i] = 0;
  init(n, 1);
  FNT(a, bit);
  FNT(b, bit);
  for (int i = 0; i < n; i++) a[i] = a[i] * b[i] % m[cur];
  init(n, -1);
  IFNT(a, bit);
}
long long ta[5][65536], tb[65536], c[5], x[5];
long long inv[5][5];
long long crt() {
  x[0] = c[0];
  for (int i = 1; i < number; i++) {
    x[i] = c[i];
    for (int j = 0; j < i; j++) {
      x[i] = (x[i] - x[j]) % m[i];
      if (x[i] < 0) x[i] += m[i];
      x[i] = x[i] * inv[j][i] % m[i];
    }
  }
  long long ans = x[number - 1];
  for (int i = number - 2; i >= 0; i--) ans = (ans * m[i] + x[i]) % mod;
  if (ans < 0) ans += mod;
  return ans;
}
void NTTs(long long *a, long long *b, int la, int lb) {
  for (int i = 0; i < number; i++) {
    memcpy(ta[i], a, sizeof(long long) * la);
    memcpy(tb, b, sizeof(long long) * lb);
    cur = i;
    NTT(ta[i], tb, la, lb);
  }
  for (int i = 0; i < number; i++)
    for (int j = i + 1; j < number; j++) inv[i][j] = pw(m[i], m[j] - 2, m[j]);
  int len = la + lb - 1, n = 1;
  while (n < len) n <<= 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < number; j++) c[j] = ta[j][i];
    a[i] = crt();
  }
}
long long dp[65536];
long long fac[65536], in[65536], ans[65536];
void cal(long long *ans, long long *dp, int k, int zx) {
  memcpy(a, ans, sizeof(long long) * (k + 1));
  for (int i = 0; i <= k; i++)
    a[i] = a[i] * in[i] % mod * pw(2, i * zx, mod) % mod;
  memcpy(b, dp, sizeof(long long) * (k + 1));
  for (int i = 0; i <= k; i++) b[i] = b[i] * in[i] % mod;
  NTTs(a, b, k + 1, k + 1);
  memcpy(ans, a, sizeof(long long) * (k + 1));
  for (int i = 0; i <= k; i++) ans[i] = ans[i] * fac[i] % mod;
}
long long C(int n, int m) { return fac[n] * in[m] % mod * in[n - m] % mod; }
int main() {
  fac[0] = 1;
  for (int i = 1; i <= 30000; i++) fac[i] = fac[i - 1] * i % mod;
  in[30000] = pw(fac[30000], mod - 2, mod);
  for (int i = 30000; i > 0; i--) in[i - 1] = in[i] * i % mod;
  long long n, k;
  cin >> n >> k;
  if (n > k)
    puts("0");
  else {
    ans[0] = 1;
    for (int i = 1; i <= k; i++) dp[i] = 1;
    int tot = 1;
    while (n) {
      if (n & 1) cal(ans, dp, k, tot);
      cal(dp, dp, k, tot);
      n >>= 1;
      tot <<= 1;
    }
    long long res = 0;
    for (int i = n; i <= k; i++) res = (res + ans[i] * C(k, i) % mod) % mod;
    cout << res << endl;
  }
  return 0;
}
