#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int P = 1e9 + 7, Lim = (1 << 15) - 1;
int fac[N], ifac[N], bit[N], rev[N], len;
inline int qpow(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) res = 1ll * res * a % P;
    a = 1ll * a * a % P;
    b >>= 1;
  }
  return res;
}
const long double PI = acos(-1.0);
struct Complex {
  long double x, y;
  Complex() {}
  Complex(long double _x, long double _y) {
    x = _x;
    y = _y;
  }
  Complex conj() { return Complex(x, -y); }
  Complex operator+(const Complex rhs) const {
    return Complex(x + rhs.x, y + rhs.y);
  }
  Complex operator-(const Complex rhs) const {
    return Complex(x - rhs.x, y - rhs.y);
  }
  Complex operator*(const Complex rhs) const {
    return Complex(x * rhs.x - y * rhs.y, x * rhs.y + y * rhs.x);
  }
} w[N], w2[N];
long long n;
int k;
inline void FFT(Complex *F, int len, int type) {
  for (int i = 0; i < len; i++)
    if (i < rev[i]) swap(F[i], F[rev[i]]);
  for (int k = 2; k <= len; k <<= 1)
    for (int j = 0; j < len; j += k) {
      for (int i = j; i < j + (k / 2); i++) {
        Complex cur = type == 1 ? w[(k / 2) + (i - j)] : w2[(k / 2) + (i - j)];
        Complex u = F[i], v = cur * F[i + (k / 2)];
        F[i] = u + v;
        F[i + (k / 2)] = u - v;
      }
    }
  if (type == -1)
    for (int i = 0; i < len; i++) F[i].x /= len, F[i].y /= len;
}
Complex A[N], B[N], C[N], D[N];
inline void MTT(int *F, int *G, int k, int *ret) {
  for (int i = 0; i < len; i++) A[i] = B[i] = C[i] = D[i] = Complex(0, 0);
  for (int i = 0; i <= k; i++) {
    A[i] = Complex(F[i] >> 15, F[i] & Lim);
    C[i] = Complex(G[i] >> 15, G[i] & Lim);
  }
  FFT(A, len, 1);
  FFT(C, len, 1);
  for (int i = 1; i < len; i++) B[i] = A[len - i].conj();
  B[0] = A[0].conj();
  for (int i = 1; i < len; i++) D[i] = C[len - i].conj();
  D[0] = C[0].conj();
  for (int i = 0; i < len; i++) {
    Complex aa = (A[i] + B[i]) * Complex(0.5, 0),
            bb = (A[i] - B[i]) * Complex(0, -0.5),
            cc = (C[i] + D[i]) * Complex(0.5, 0),
            dd = (C[i] - D[i]) * Complex(0, -0.5);
    A[i] = aa * cc + Complex(0, 1) * (aa * dd + bb * cc), B[i] = bb * dd;
  }
  FFT(A, len, -1);
  FFT(B, len, -1);
  for (int i = 0; i <= k; i++) {
    int aa = (long long)(A[i].x + 0.5) % P, bb = (long long)(A[i].y + 0.5) % P,
        cc = (long long)(B[i].x + 0.5) % P;
    ret[i] = (1ll * aa * (1 << 30) % P + 1ll * bb * (1 << 15) % P + cc % P) % P;
    ret[i] = (ret[i] + P) % P;
  }
}
int f[N], g[N], tmp[N];
inline void solve(long long n, int k) {
  if (n == 1) {
    f[0] = 0;
    for (int i = 1; i < k; i++) f[i] = ifac[i];
    return;
  }
  solve(n >> 1, k);
  for (int i = 0; i < k; i++)
    g[i] = 1ll * f[i] * qpow(2, 1ll * (n >> 1) * i % (P - 1)) % P;
  for (int i = 0; i < len; i++) tmp[i] = 0;
  MTT(f, g, k, tmp);
  for (int i = 0; i < k; i++) f[i] = tmp[i];
  if (n & 1) {
    g[0] = 0;
    for (int i = 0; i < len; i++) tmp[i] = 0;
    for (int i = 1; i < k; i++)
      f[i] = 1ll * f[i] * qpow(2, i) % P, g[i] = ifac[i];
    MTT(f, g, k, tmp);
    for (int i = 0; i < k; i++) f[i] = tmp[i];
  }
  for (int i = k; i < len; i++) f[i] = 0;
  for (int i = 0; i < len; i++) g[i] = 0;
}
int main() {
  cin >> n >> k;
  if (n > k) return puts("0"), 0;
  fac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = 1ll * fac[i - 1] * i % P;
  ifac[N - 1] = qpow(fac[N - 1], P - 2);
  for (int i = N - 2; i >= 1; i--) ifac[i] = qpow(fac[i], P - 2);
  ifac[0] = 1;
  len = 1;
  while (len <= (k + 1) * 2) len <<= 1;
  for (int i = 0; i < len; i++) {
    rev[i] = rev[i >> 1] >> 1;
    if (i & 1) rev[i] |= len >> 1;
  }
  for (int i = 1; i < len; i <<= 1) {
    w[i] = Complex(1, 0);
    for (int j = 1; j < i; j++)
      w[i + j] = ((j & 31) == 1 ? Complex(cos(PI * j / i), sin(PI * j / i))
                                : w[i + j - 1] * w[i + 1]);
  }
  for (int i = 1; i < len; i++) w2[i] = w[i].conj();
  solve(n, k + 1);
  long long ans = 0;
  for (int i = 1; i <= k; i++)
    ans = (ans + 1ll * f[i] * fac[k] % P * ifac[k - i] % P) % P;
  cout << ans;
}
