#include <bits/stdc++.h>
using namespace std;
const int G = 3;
const long long INF = 1e16;
const int BASE = 131;
const double eps = 1e-14;
const int mod = 1000000007;
const int inf = 1061109567;
const double pi = acos(-1);
const int inv2 = (mod + 1) >> 1;
namespace Math {
inline long long F(long long x, long long p) { return x >= p ? x - p : x; }
inline long long gcd(long long a, long long b) {
  return b ? gcd(b, a - a / b * b) : a;
}
inline long long ksm(long long x, long long t, long long p) {
  long long res = 1;
  while (t > 0) {
    if (t & 1) res = res * x % p;
    x = x * x % p;
    t >>= 1;
  }
  return res;
}
}  // namespace Math
using Math::F;
using Math::gcd;
using Math::ksm;
template <typename tp>
inline void read(tp &dig) {
  char ch = getchar();
  long long flag = 0;
  dig = 0;
  while (!isdigit(ch)) {
    if (ch == '-') flag = 1;
    ch = getchar();
  }
  while (isdigit(ch)) dig = dig * 10 + ch - '0', ch = getchar();
  if (flag) dig = -dig;
}
template <typename tp, typename... Args>
inline void read(tp &dig, Args &...args) {
  read(dig);
  read(args...);
}
struct cpx {
  double x, y;
  cpx(double xx = 0, double yy = 0) { x = xx, y = yy; }
} f[100010], g[100010], P[100010], Q[100010], w[100010];
inline cpx operator+(const cpx &a, const cpx &b) {
  return cpx(a.x + b.x, a.y + b.y);
}
inline cpx operator-(const cpx &a, const cpx &b) {
  return cpx(a.x - b.x, a.y - b.y);
}
inline cpx operator*(const cpx &a, const cpx &b) {
  return cpx(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x);
}
inline cpx conj(const cpx &a) { return cpx(a.x, -a.y); }
long long n, m, K, fac[100010], inv[100010], bin[100010];
int a[100010], b[100010], rev[100010];
int gn[2][31];
inline int C(int N, int M) {
  if (M > N) return 0;
  return fac[N] * inv[M] % mod * inv[N - M] % mod;
}
inline void pre_work(int N) {
  fac[0] = inv[0] = bin[0] = 1;
  for (int i = 1; i <= N; ++i)
    fac[i] = fac[i - 1] * i % mod, bin[i] = F(bin[i - 1] << 1, mod);
  inv[N] = ksm(fac[N], mod - 2, mod);
  for (int i = N - 1; i; --i) inv[i] = inv[i + 1] * (i + 1) % mod;
}
inline void fft(cpx *A, int lim, int L, int f) {
  for (int i = 0; i < lim; ++i) {
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << L - 1);
    if (i < rev[i]) swap(A[i], A[rev[i]]);
  }
  for (int i = 1; i < lim; i <<= 1)
    for (int j = 0, R = i << 1; j < lim; j += R)
      for (int k = 0; k < i; ++k) {
        cpx x = A[j + k], y = w[lim / i * k] * A[j + k + i];
        A[j + k] = x + y;
        A[j + k + i] = x - y;
      }
  if (f < 0) {
    for (int i = 0; i < lim; ++i) A[i].x /= lim, A[i].y /= lim;
  }
}
inline void mul(int *A, int *B, int lim, int L, int rt) {
  for (int i = 0, x, y; i <= K; ++i) {
    x = inv[i] * A[i] % mod * ksm(bin[i], rt, mod) % mod;
    y = inv[i] * B[i] % mod;
    P[i] = cpx(x >> 15, x & 32767);
    Q[i] = cpx(y >> 15, y & 32767);
  }
  for (int i = K + 1; i < lim; ++i) P[i] = Q[i] = cpx(0, 0);
  for (int i = 0; i < lim; ++i)
    w[i] = cpx(cos(pi * i / lim), sin(pi * i / lim));
  fft(P, lim, L, 1);
  fft(Q, lim, L, 1);
  cpx s(0.5, 0), t(0, -0.5), I(0, 1);
  for (int i = 0; i < lim; ++i) {
    int j = (lim - i) & (lim - 1);
    static cpx da, db, dc, dd;
    da = (P[i] + conj(P[j])) * s;
    db = (P[i] - conj(P[j])) * t;
    dc = (Q[i] + conj(Q[j])) * s;
    dd = (Q[i] - conj(Q[j])) * t;
    f[j] = da * dc + da * dd * I;
    g[j] = db * dc + db * dd * I;
  }
  fft(f, lim, L, -1);
  fft(g, lim, L, -1);
  for (int i = 0; i < lim; ++i) {
    long long da = (long long)(f[i].x + 0.5) % mod,
              db = (long long)(f[i].y + 0.5) % mod;
    long long dc = (long long)(g[i].x + 0.5) % mod,
              dd = (long long)(g[i].y + 0.5) % mod;
    A[i] = (((da << 30) % mod + (db + dc << 15) % mod + dd) % mod + mod) % mod;
    A[i] = fac[i] * A[i] % mod;
  }
}
int main() {
  read(n);
  read(K);
  m = K - n;
  if (n > K) {
    printf("0\n");
    return 0;
  }
  int lim = 1, L = 0, N = n - 1, rt = 1, ans = 0;
  while (lim <= K * 2) lim <<= 1, ++L;
  pre_work(lim);
  for (int i = 1; i <= K; ++i) a[i] = b[i] = 1;
  while (N) {
    if (N & 1) mul(a, b, lim, L, rt);
    mul(b, b, lim, L, rt);
    N >>= 1;
    rt <<= 1;
  }
  for (int i = n; i <= K; ++i) ans = F(ans + 1LL * C(K, i) * a[i] % mod, mod);
  printf("%d\n", ans);
  return 0;
}
