#include <bits/stdc++.h>
using namespace std;
const int p = 1000000007;
const int p1 = 469762049, p2 = 998244353, p3 = 1004535809;
long long zn;
int n, k, s, l, len;
int inv[131075], fac[131075], infac[131075];
int inv1, inv2, inv3;
long long M;
int a[131075], b[131075], c[131075], d[131075], f[131075], g[131075];
void Add(int &x, int y) { x = (x + y) % p; }
void Del(int &x, int y) { x = (x - y + p) % p; }
void Mul(int &x, int y) { x = (long long)x * y % p; }
int add(int x, int y) { return (x + y) % p; }
int del(int x, int y) { return (x - y + p) % p; }
int mul(int x, int y) { return (long long)x * y % p; }
int ksm(int x, int y) {
  int ans = 1;
  while (y) {
    if (y & 1) Mul(ans, x);
    Mul(x, x);
    y >>= 1;
  }
  return ans;
}
long long low_mul(long long x, long long y, long long p) {
  long long ans = 0;
  while (y) {
    if (y & 1) ans = (ans + x) % p;
    x = (x << 1) % p;
    y >>= 1;
  }
  return ans;
}
int C(int n, int k) { return mul(fac[n], mul(infac[k], infac[n - k])); }
struct ntt {
  int p, tw, gi, s, l;
  int G[2][35], f[131075], g[131075], rev[131075];
  void Set(int A, int B, int C) { p = A, tw = B, gi = C; }
  void Add(int &x, int y) { x = (x + y) % p; }
  void Del(int &x, int y) { x = (x - y + p) % p; }
  void Mul(int &x, int y) { x = (long long)x * y % p; }
  int add(int x, int y) { return (x + y) % p; }
  int del(int x, int y) { return (x - y + p) % p; }
  int mul(int x, int y) { return (long long)x * y % p; }
  int ksm(int x, int y) {
    int ans = 1;
    while (y) {
      if (y & 1) Mul(ans, x);
      Mul(x, x);
      y >>= 1;
    }
    return ans;
  }
  void Pre() {
    G[0][tw] = ksm(3, (p - 1) / (1 << tw));
    G[1][tw] = ksm(G[0][tw], p - 2);
    for (int i = tw - 1; i; --i) {
      G[0][i] = mul(G[0][i + 1], G[0][i + 1]);
      G[1][i] = mul(G[1][i + 1], G[1][i + 1]);
    }
  }
  void solve(int n) {
    s = 1, l = 0;
    while (s < n) s <<= 1, ++l;
    for (int i = 0; i < s; ++i)
      rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << l - 1);
  }
  void NTT(int *a, int t) {
    for (int i = 0; i < s; ++i)
      if (i < rev[i]) swap(a[i], a[rev[i]]);
    for (int mid = 1, o = 1; mid < s; mid <<= 1, ++o)
      for (int j = 0; j < s; j += mid << 1) {
        int g = 1;
        for (int k = 0; k < mid; ++k, Mul(g, G[t][o])) {
          int x = a[j + k], y = mul(g, a[j + k + mid]);
          a[j + k] = add(x, y), a[j + k + mid] = del(x, y);
        }
      }
  }
  void main(int *a, int *b, int n) {
    memcpy(f, a, n * sizeof(int)), memcpy(g, b, n * sizeof(int));
    solve(n);
    NTT(f, 0), NTT(g, 0);
    for (int i = 0; i < s; ++i) Mul(f[i], g[i]);
    NTT(f, 1);
    int invs = ksm(s, p - 2);
    for (int i = 0; i < s; ++i) Mul(f[i], invs);
  }
  void clear() {
    memset(f, 0, s * sizeof(int));
    memset(g, 0, s * sizeof(int));
  }
} ntt1, ntt2, ntt3;
void Poly_Mul(int *a, int *b, int *f, int n, int m) {
  ntt1.main(a, b, n), ntt2.main(a, b, n), ntt3.main(a, b, n);
  for (int i = 0; i <= m; ++i) {
    long long x = (low_mul(ntt1.f[i], (long long)p2 * inv1, M) +
                   low_mul(ntt2.f[i], (long long)p1 * inv2, M)) %
                  M;
    int k = ((long long)ntt3.f[i] - x % p3 + p3) * inv3 % p3;
    f[i] = add(mul(k % p, M % p), x % p);
  }
  ntt1.clear(), ntt2.clear(), ntt3.clear();
}
void shift() {
  memcpy(a, f, (k + 1) * sizeof(int));
  for (int i = 0; i <= k; ++i)
    Mul(a[i], mul(infac[i], ksm(2, (long long)len * i % (p - 1))));
  memcpy(b, f, (k + 1) * sizeof(int));
  for (int i = 0; i <= k; ++i) Mul(b[i], infac[i]);
  Poly_Mul(a, b, f, (k + 1) << 1, k);
  for (int i = 0; i <= k; ++i) Mul(f[i], fac[i]);
  memset(a, 0, s * sizeof(int)), memset(b, 0, s * sizeof(int));
}
void nxt() {
  memcpy(a, f, (k + 1) * sizeof(int));
  for (int i = 0; i <= k; ++i) Mul(a[i], mul(infac[i], ksm(2, i)));
  memcpy(b, infac, (k + 1) * sizeof(int));
  b[0] = 0;
  Poly_Mul(a, b, f, (k + 1) << 1, k);
  for (int i = 0; i <= k; ++i) Mul(f[i], fac[i]);
  memset(a, 0, s * sizeof(int)), memset(b, 0, s * sizeof(int));
}
int main() {
  scanf("%lld%d", &zn, &k);
  if (zn > k) {
    puts("0");
    return 0;
  }
  n = zn;
  ntt1.Set(p1, 26, 3), ntt2.Set(p2, 23, 3), ntt3.Set(p3, 21, 3);
  ntt1.Pre(), ntt2.Pre(), ntt3.Pre();
  inv1 = ntt1.ksm(p2, p1 - 2), inv2 = ntt2.ksm(p1, p2 - 2);
  M = (long long)p1 * p2;
  inv3 = ntt3.ksm(M % p3, p3 - 2);
  inv[1] = fac[0] = fac[1] = infac[0] = infac[1] = 1;
  for (int i = 2; i <= 131072; ++i)
    inv[i] = mul(p - p / i, inv[p % i]), fac[i] = mul(fac[i - 1], i),
    infac[i] = mul(infac[i - 1], inv[i]);
  s = 1, l = 0;
  while (s <= n) s <<= 1, ++l;
  --l;
  for (int i = 1; i <= k; ++i) f[i] = 1;
  len = 1;
  for (int i = l - 1; i >= 0; --i) {
    shift(), len <<= 1;
    if ((n >> i) & 1) nxt(), ++len;
  }
  int ans = 0;
  for (int i = 0; i <= k; ++i) Add(ans, mul(C(k, i), f[i]));
  printf("%d\n", ans);
  return 0;
}
