#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int NN = 1 << 16;
const double pi = acosl(-1.0);
const int N = 1 << 16, LN = __builtin_ctz(N), L = 15, MASK = (1 << L) - 1;
int bitrev[N];
complex<double> w[N];
void FFTInit() {
  for (int i = 0; i < N; i++) {
    bitrev[i] = (bitrev[i >> 1] >> 1) | ((i & 1) << (LN - 1));
    w[i] = complex<double>(cos(2 * i * pi / N), sin(2 * i * pi / N));
  }
}
void FFT(complex<double> p[], int n) {
  for (int i = 0; i < n; i++)
    if (i < bitrev[i]) swap(p[i], p[bitrev[i]]);
  for (int d = 0; (1 << d) < n; d++) {
    int m = 1 << d, m2 = m * 2, rm = n >> (d + 1);
    for (int i = 0; i < n; i += m2) {
      for (int j = 0; j < m; j++) {
        complex<double> &p1 = p[i + j + m], &p2 = p[i + j];
        complex<double> t = w[rm * j] * p1;
        p1 = p2 - t;
        p2 = p2 + t;
      }
    }
  }
}
complex<double> A[N], B[N], C[N], D[N];
void mul(int a[N], int b[N], int k = N) {
  for (int i = 0; i < k; i++) {
    A[i] = complex<double>(a[i] >> L, a[i] & MASK);
    B[i] = complex<double>(b[i] >> L, b[i] & MASK);
  }
  for (int i = k; i < N; i++) A[i] = B[i] = complex<double>(0, 0);
  FFT(A, N);
  FFT(B, N);
  for (int i = 0; i < N; i++) {
    int j = (N - i) % N;
    complex<double> da = (A[i] - conj(A[j])) * complex<double>(0, -0.5),
                    db = (A[i] + conj(A[j])) * complex<double>(0.5, 0),
                    dc = (B[i] - conj(B[j])) * complex<double>(0, -0.5),
                    dd = (B[i] + conj(B[j])) * complex<double>(0.5, 0);
    C[j] = da * dd + da * dc * complex<double>(0, 1);
    D[j] = db * dd + db * dc * complex<double>(0, 1);
  }
  FFT(C, N);
  FFT(D, N);
  for (int i = 0; i < k; i++) {
    long long da = (long long)(C[i].imag() / N + 0.5) % MOD,
              db = (long long)(C[i].real() / N + 0.5) % MOD,
              dc = (long long)(D[i].imag() / N + 0.5) % MOD,
              dd = (long long)(D[i].real() / N + 0.5) % MOD;
    a[i] = ((dd << (L * 2)) + ((db + dc) << L) + da) % MOD;
  }
}
int k;
int a[NN], b[NN], fac[NN], rev[NN], ta[NN], tb[NN];
int power(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (long long)ans * a % MOD;
    b >>= 1;
    a = (long long)a * a % MOD;
  }
  return ans;
}
void multi(int *a, int *b, int len) {
  for (int i = 0; i <= k; i++) {
    ta[i] = (long long)a[i] * power(2, (long long)i * len % (MOD - 1)) % MOD *
            rev[i] % MOD;
    tb[i] = (long long)b[i] * rev[i] % MOD;
  }
  mul(ta, tb, k + 1);
  for (int i = 0; i <= k; i++) a[i] = (long long)ta[i] * fac[i] % MOD;
}
int main() {
  long long n;
  scanf("%I64d%d", &n, &k);
  if (n > k) return puts("0");
  for (int i = fac[0] = 1; i < NN; i++)
    fac[i] = (long long)fac[i - 1] * i % MOD;
  rev[NN - 1] = power(fac[NN - 1], MOD - 2);
  for (int i = NN - 2; i >= 0; i--)
    rev[i] = (long long)rev[i + 1] * (i + 1) % MOD;
  FFTInit();
  for (int i = 1; i <= k; i++) b[i] = 1;
  a[0] = 1;
  int len = 1;
  while (n) {
    if (n & 1) multi(a, b, len);
    multi(b, b, len);
    len <<= 1;
    n >>= 1;
  }
  int ans = 0, mid = 1;
  for (int i = 1; i <= k; i++) {
    mid = (long long)mid * (k - i + 1) % MOD * rev[i] % MOD * fac[i - 1] % MOD;
    ans = (ans + (long long)a[i] * mid) % MOD;
  }
  cout << ans << endl;
  return 0;
}
