#include <bits/stdc++.h>
using namespace std;
long long mod[3] = {998244353, 1004535809, 469762049};
long long P, p;
inline long long Pow(long long x, int a, long long P) {
  if (a == 0) return 1;
  if (a == 1) return x % P;
  long long y = Pow(x, a >> 1, P);
  y = (y * y) % P;
  if (a & 1) y = (y * x) % P;
  return y;
}
int n, k;
long long fac[131075], inv[131075];
long long f[131075], a[131075];
long long C(int n, int m) { return fac[n] * inv[m] % p * inv[n - m] % p; }
void init() {
  fac[0] = 1;
  inv[0] = 1;
  for (int i = 1; i <= 30000; i++) {
    fac[i] = (fac[i - 1] * (long long)(i)) % p;
    inv[i] = Pow(fac[i], p - 2, p);
  }
}
int L, R[131075];
int pre_ntt(int m) {
  int n = 1;
  L = 0;
  for (n = 1, L = 0; n <= m; n <<= 1) L++;
  for (int i = 0; i <= n; i++) R[i] = (R[i >> 1] >> 1) | ((i & 1) << (L - 1));
  return n;
}
inline void ntt(int n, long long *a, int t) {
  for (int i = 1; i < n; i++)
    if (i > R[i]) swap(a[i], a[R[i]]);
  long long x, y;
  int l, q;
  for (int i = 1; (i << 1) <= n; i <<= 1) {
    q = i << 1;
    long long wn = Pow(3, t == 1 ? (P - 1) / q : P - 1 - (P - 1) / q, P);
    for (int j = 0; j < n; j += q) {
      long long w = 1;
      for (int k = 0; k < i; k++, w = (w * wn) % P) {
        l = k + j;
        x = a[l];
        y = w * a[i + l] % P;
        a[l] = x + y;
        a[i + l] = x - y + P;
        if (a[l] >= P) a[l] -= P;
        while (a[i + l] >= P) a[i + l] -= P;
      }
    }
  }
  if (t == -1) {
    long long invn = Pow(n, P - 2, P);
    for (int i = 0; i < n; i++) a[i] = (a[i] * invn) % P;
  }
}
void mul(int n, long long *a, long long *b, long long *c) {
  static long long a1[131075], b1[131075];
  memcpy(a1, a, n * sizeof(long long));
  memcpy(b1, b, n * sizeof(long long));
  ntt(n, a1, 1);
  ntt(n, b1, 1);
  for (int i = 0; i <= n; i++) c[i] = (a1[i] * b1[i]) % P;
  ntt(n, c, -1);
}
long long mul(long long a, long long b, long long p) {
  long long ans = 0;
  while (a) {
    if (a & 1ll) {
      ans += b;
      if (ans >= p) ans -= p;
    }
    b = b + b;
    if (b >= p) b -= p;
    a >>= 1;
  }
  return ans;
}
inline long long CRT(long long x, long long y, long long z) {
  long long t = mod[0] * mod[1];
  long long d =
      (mul(Pow(mod[1] % mod[0], mod[0] - 2, mod[0]), x * mod[1] % t, t) +
       mul(Pow(mod[0] % mod[1], mod[1] - 2, mod[1]), y * mod[0] % t, t)) %
      t;
  long long k = (((z - d) % mod[2] + mod[2]) % mod[2] *
                 Pow(t % mod[2], mod[2] - 2, mod[2])) %
                mod[2];
  return (k % p * (t % p) % p + d % p) % p;
}
void mul(int n, int m, long long *a, long long *b, long long *c) {
  static long long d[3][131075];
  int len = pre_ntt(n + m);
  for (int i = 0; i < 3; i++) P = mod[i], mul(len, a, b, d[i]);
  for (int i = 0; i <= n; i++) c[i] = CRT(d[0][i], d[1][i], d[2][i]);
}
void Solve(int n) {
  if (n == 1) {
    f[0] = 0;
    for (int i = 1; i <= k; i++) f[i] = 1;
    return;
  }
  Solve(n >> 1);
  for (int i = 1; i <= k; i++) {
    long long x = Pow(2, (n >> 1) * i % (p - 1), p);
    f[i] = (f[i] * inv[i]) % p;
    a[i] = (f[i] * x) % p;
  }
  mul(k, k, a, f, f);
  for (int i = 1; i <= k; i++) f[i] = (f[i] * fac[i]) % p;
  if (n & 1) {
    for (int i = 1; i <= k; i++) {
      f[i] = f[i] * inv[i] % p * Pow(2, i, p) % p;
      a[i] = inv[i];
    }
    mul(k, k, a, f, f);
    for (int i = 1; i <= k; i++) f[i] = (f[i] * fac[i]) % p;
  }
}
int main() {
  p = 1000000007;
  cin >> n >> k;
  init();
  if (n > k)
    puts("0");
  else {
    Solve(n);
    long long ans = 0;
    for (int i = 1; i <= k; i++) {
      ans += (f[i] * C(k, i)) % p;
      if (ans >= p) ans -= p;
    }
    cout << ans << endl;
  }
  return 0;
}
