#include <bits/stdc++.h>
using namespace std;
double Pi = acos(-1.0);
int n, k, f[65536], g[65536], F[65536], G[65536], ans, e, ep, fc[65536],
    xf[65536];
long long hcy;
struct cp {
  double x, y;
  cp(double _x = 0, double _y = 0) { x = _x, y = _y; }
} w[65536], a[65536], b[65536], c[65536], d[65536], A[65536], B[65536],
    C[65536], emp, tmp[65536];
cp operator+(cp p, cp q) { return cp(p.x + q.x, p.y + q.y); }
cp operator-(cp p, cp q) { return cp(p.x - q.x, p.y - q.y); }
cp operator*(cp p, cp q) {
  return cp(p.x * q.x - p.y * q.y, p.x * q.y + p.y * q.x);
}
long long fpm(long long x, long long y) {
  long long s = 1;
  while (y) {
    if (y & 1) s = (s * x) % 1000000007;
    y >>= 1, x = (x * x) % 1000000007;
  }
  return s;
}
int rev(int x) {
  int i, y = 0;
  for (i = 0; i < ep; i++) y += ((x >> i) & 1) * (1 << (ep - i - 1));
  return y;
}
void FFT(cp *x, int op) {
  int i, j, k;
  cp p, q;
  for (i = 0; i < e; i++) tmp[i] = x[i];
  for (i = 0; i < e; i++) x[i] = tmp[rev(i)];
  for (i = 1; i <= e; i <<= 1) {
    for (j = 0; j < i / 2; j++)
      w[j] = cp(cos(2 * Pi * op * j / i), sin(2 * Pi * op * j / i));
    for (j = 0; j < e; j += i)
      for (k = 0; k < i / 2; k++) {
        p = x[j + k], q = x[j + k + i / 2] * w[k];
        x[j + k] = p + q, x[j + k + i / 2] = p - q;
      }
  }
}
void power(int *u, int *v, int p) {
  int i;
  for (i = 0; i < e; i++) a[i] = b[i] = c[i] = d[i] = A[i] = B[i] = C[i] = emp;
  for (i = 0; i <= k; i++) {
    F[i] = 1LL * u[i] * fc[k - i] % 1000000007 * fpm(p, i) % 1000000007;
    G[i] = 1LL * v[i] * fc[k - i] % 1000000007;
  }
  for (i = 0; i < e; i++)
    a[i].x = F[i] / 31622, b[i].x = F[i] % 31622, c[i].x = G[i] / 31622,
    d[i].x = G[i] % 31622;
  FFT(a, 1), FFT(b, 1), FFT(c, 1), FFT(d, 1);
  for (i = 0; i < e; i++) {
    A[i] = a[i] * c[i];
    B[i] = a[i] * d[i] + b[i] * c[i];
    C[i] = b[i] * d[i];
  }
  FFT(A, -1), FFT(B, -1), FFT(C, -1);
  for (i = 0; i <= k; i++) {
    u[i] =
        (long long)(A[i].x / e + 0.5) * 31622 % 1000000007 * 31622 % 1000000007;
    u[i] = (u[i] + (long long)(B[i].x / e + 0.5) % 1000000007 * 31622) %
           1000000007;
    u[i] = (u[i] + (long long)(C[i].x / e + 0.5)) % 1000000007;
  }
  for (i = 0; i <= k; i++)
    u[i] = 1LL * u[i] * xf[k - i] % 1000000007 * xf[k] % 1000000007;
}
int main() {
  int i, T = 2;
  cin >> hcy >> k;
  if (hcy > k) {
    printf("0");
    return 0;
  }
  fc[0] = xf[0] = 1;
  for (i = 1; i <= k; i++) {
    fc[i] = (1LL * fc[i - 1] * i) % 1000000007;
    xf[i] = fpm(fc[i], 1000000007 - 2);
  }
  for (e = 1, ep = 0; e <= 2 * k; e <<= 1, ep++)
    ;
  n = hcy, f[0] = 1, hcy = 1;
  for (i = 1; i <= k; i++)
    hcy = hcy * fpm(i, 1000000007 - 2) % 1000000007 * (k - i + 1) % 1000000007,
    g[i] = hcy;
  while (n) {
    if (n & 1) power(f, g, T);
    n >>= 1, power(g, g, T);
    T = (1LL * T * T) % 1000000007;
  }
  for (i = n; i <= k; i++) ans = (ans + f[i]) % 1000000007;
  cout << ans;
  return 0;
}
