#include <bits/stdc++.h>
using namespace std;
long long N;
int K;
const long long Mod = 1e9 + 7;
long long fact[66000] = {0};
long long inv[66000] = {0};
long long pow2[66000] = {0};
int N2 = 0;
double PI = acos(-1);
long double Sin[66000] = {0};
long double Cos[66000] = {0};
struct Complex {
  long double re, im;
  Complex() { re = im = 0; }
  Complex(long double re_, long double im_) { re = re_, im = im_; };
};
Complex operator*(Complex a1, Complex a2) {
  return Complex(a1.re * a2.re - a1.im * a2.im, a1.re * a2.im + a2.re * a1.im);
}
Complex operator-(Complex a1, Complex a2) {
  return Complex(a1.re - a2.re, a1.im - a2.im);
}
Complex operator+(Complex a1, Complex a2) {
  return Complex(a1.re + a2.re, a1.im + a2.im);
}
Complex operator/(Complex a1, long double a2) {
  return Complex(a1.re / a2, a1.im / a2);
}
Complex A[66000], B[66000];
long long Cnt[66000] = {0};
long long tmp[66000] = {0};
long long F[66000] = {0};
long long power(long long a, long long k) {
  long long o = 1;
  for (; k > 0; k >>= 1) {
    if (k & 1) o = o * a % Mod;
    a = a * a % Mod;
  }
  return o;
}
void FFT(Complex *Q, int Num, int flag) {
  for (int i = 0; i < Num; i++) {
    int S = i, P = 0;
    for (int j = Num >> 1; j > 0; j >>= 1, S >>= 1) P |= (S & 1) * j;
    if (P > i) swap(Q[i], Q[P]);
  }
  for (int l = 2; l <= Num; l <<= 1) {
    for (int i = 0; i < Num; i += l) {
      for (int j = 0; j < (l >> 1); j++) {
        Complex Wk = Complex(Cos[Num / l * j], Sin[Num / l * j] * flag);
        Complex u = Q[i + j], v = Q[i + j + (l >> 1)] * Wk;
        Q[i + j] = u + v;
        Q[i + j + (l >> 1)] = u - v;
      }
    }
  }
  if (flag == -1) {
    for (int i = 0; i < Num; i++) Q[i] = Q[i] / (long double)Num;
  }
  return;
}
int mult(long long *Q, long long *R, int len1, int len2) {
  memset(tmp, 0, sizeof(tmp));
  for (int i = 0; i < N2; i++)
    A[i].re =
        Q[i] * inv[i] % Mod * power(2, i * len2 % (Mod - 1)) % Mod / 32000,
    B[i].re = R[i] * inv[i] % Mod / 32000, A[i].im = B[i].im = 0;
  FFT(A, N2, 1);
  FFT(B, N2, 1);
  for (int i = 0; i < N2; i++) A[i] = A[i] * B[i];
  FFT(A, N2, -1);
  for (int i = 0; i < N2; i++)
    (tmp[i] += ((long long)(A[i].re + 0.5)) % Mod * 32000 % Mod * 32000 % Mod *
               fact[i] % Mod) %= Mod;
  for (int i = 0; i < N2; i++)
    A[i].re =
        Q[i] * inv[i] % Mod * power(2, i * len2 % (Mod - 1)) % Mod % 32000,
    B[i].re = R[i] * inv[i] % Mod / 32000, A[i].im = B[i].im = 0;
  FFT(A, N2, 1);
  FFT(B, N2, 1);
  for (int i = 0; i < N2; i++) A[i] = A[i] * B[i];
  FFT(A, N2, -1);
  for (int i = 0; i < N2; i++)
    (tmp[i] +=
     ((long long)(A[i].re + 0.5)) % Mod * 32000 % Mod * fact[i] % Mod) %= Mod;
  for (int i = 0; i < N2; i++)
    A[i].re =
        Q[i] * inv[i] % Mod * power(2, i * len2 % (Mod - 1)) % Mod / 32000,
    B[i].re = R[i] * inv[i] % Mod % 32000, A[i].im = B[i].im = 0;
  FFT(A, N2, 1);
  FFT(B, N2, 1);
  for (int i = 0; i < N2; i++) A[i] = A[i] * B[i];
  FFT(A, N2, -1);
  for (int i = 0; i < N2; i++)
    (tmp[i] +=
     ((long long)(A[i].re + 0.5)) % Mod * 32000 % Mod * fact[i] % Mod) %= Mod;
  for (int i = 0; i < N2; i++)
    A[i].re =
        Q[i] * inv[i] % Mod * power(2, i * len2 % (Mod - 1)) % Mod % 32000,
    B[i].re = R[i] * inv[i] % Mod % 32000, A[i].im = B[i].im = 0;
  FFT(A, N2, 1);
  FFT(B, N2, 1);
  for (int i = 0; i < N2; i++) A[i] = A[i] * B[i];
  FFT(A, N2, -1);
  for (int i = 0; i < N2; i++)
    (tmp[i] += ((long long)(A[i].re + 0.5)) % Mod * fact[i] % Mod) %= Mod;
  for (int i = 0; i <= K; i++) Q[i] = tmp[i];
  return len1 + len2;
}
void powerpoly(long long *F0, long long *ret, long long k) {
  ret[0] = 1;
  int len1 = 1;
  int len2 = 0;
  for (; k > 0; k >>= 1) {
    if (k & 1) len2 = mult(ret, F0, len2, len1);
    len1 = mult(F0, F0, len1, len1);
  }
  return;
}
int main() {
  cin >> N >> K;
  if (N > K)
    puts("0");
  else {
    for (N2 = 1; N2 < K + K + 1; N2 <<= 1)
      ;
    fact[0] = inv[0] = 1;
    for (int i = 1; i <= N2; i++)
      fact[i] = fact[i - 1] * i % Mod, inv[i] = power(fact[i], Mod - 2);
    for (int i = 0; i < N2; i++)
      Sin[i] = sin(2 * PI / N2 * i), Cos[i] = cos(2 * PI / N2 * i);
    for (int i = 1; i <= K; i++) Cnt[i] = 1;
    powerpoly(Cnt, F, N);
    long long Ans = 0;
    for (int i = 1; i <= K; i++)
      (Ans += F[i] * (fact[K] * inv[i] % Mod * inv[(K) - (i)] % Mod) % Mod) %=
          Mod;
    cout << Ans << endl;
  }
  return 0;
}
