#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 16, B = 1 << 15;
const int mod = 1000000007;
const double pi = acos(-1.0);
struct Complex {
  double x, y;
  Complex() {}
  Complex(double a, double b) { x = a, y = b; }
  Complex operator*(const Complex &A) const {
    return Complex(x * A.x - y * A.y, x * A.y + y * A.x);
  }
  Complex operator-(const Complex &A) const {
    return Complex(x - A.x, y - A.y);
  }
  Complex operator+(const Complex &A) const {
    return Complex(x + A.x, y + A.y);
  }
  Complex conj() const { return Complex(x, -y); }
  Complex operator/(const int &A) const { return Complex(x / A, y / A); }
};
int a[1 << 16], res[1 << 16];
Complex tmp[1 << 16], ttt[1 << 16];
Complex t1[2][1 << 16], t2[2][1 << 16];
long long fac[1 << 16], inv[1 << 16], pw[1 << 16];
int num[1 << 16];
Complex W[1 << 16 | 5];
long long power(int a, int b) {
  if (!b) return 1;
  long long tmp = power(a, b >> 1);
  return b & 1 ? tmp * tmp % mod * a % mod : tmp * tmp % mod;
}
void FFT(Complex *a, int N, Complex *f, int flag) {
  for (int i = 0; i < N; i++) {
    f[i] = a[num[i]];
  }
  for (int len = 2; len <= N; len <<= 1) {
    for (int i = 0; i < N; i += len) {
      int now = flag ? N : 0, delta = flag ? -N / len : N / len;
      for (int j = i; j < i + (len >> 1); j++) {
        Complex tmp = f[j + (len >> 1)] * W[now];
        f[j + (len >> 1)] = f[j] - tmp;
        f[j] = f[j] + tmp;
        now += delta;
      }
    }
  }
  if (flag) {
    for (int i = 0; i < N; i++) {
      f[i].x /= N;
    }
  }
}
long long C(int n, int k) { return fac[n] * inv[k] % mod * inv[n - k] % mod; }
int main() {
  for (int i = 0; i <= N; i++) {
    W[i] = Complex(cos(2 * pi * i / N), sin(2 * pi * i / N));
  }
  for (int i = 0; i < N; i++) {
    num[i] = num[i >> 1] >> 1 | (i & 1 ? N >> 1 : 0);
  }
  fac[0] = inv[0] = pw[0] = 1;
  for (int i = 1; i < (1 << 16); i++) {
    pw[i] = pw[i - 1] * 2 % mod;
    fac[i] = fac[i - 1] * i % mod;
    inv[i] = power(fac[i], mod - 2);
  }
  long long n;
  int k;
  cin >> n >> k;
  if (n > k) {
    printf("0\n");
    return 0;
  }
  memset(a, 0, sizeof(a)), memset(res, 0, sizeof(res));
  for (int i = 1; i <= k; i++) {
    a[i] = inv[i];
  }
  res[0] = 1;
  int cur = 0;
  for (int it = 0; it < 15; it++) {
    if (n >> it & 1) {
      for (int j = 0; j < N; j++)
        tmp[j] = Complex(a[j] * power(pw[j], cur) % mod % B, 0);
      FFT(tmp, N, t1[0], 0);
      for (int j = 0; j < N; j++)
        tmp[j] = Complex(a[j] * power(pw[j], cur) % mod / B, 0);
      FFT(tmp, N, t1[1], 0);
      for (int j = 0; j < N; j++) tmp[j] = Complex(res[j] % B, 0);
      FFT(tmp, N, t2[0], 0);
      for (int j = 0; j < N; j++) tmp[j] = Complex(res[j] / B, 0);
      FFT(tmp, N, t2[1], 0);
      for (int j = 0; j < N; j++) res[j] = 0;
      for (int p = 0; p < 2; p++) {
        for (int q = 0; q < 2; q++) {
          for (int j = 0; j < N; j++) {
            tmp[j] = t1[p][j] * t2[q][j];
          }
          FFT(tmp, N, ttt, 1);
          long long mul = (1ll << (p + q) * 15) % mod;
          for (int j = 0; j < N; j++) {
            res[j] = (res[j] + (long long)(ttt[j].x + 0.5) % mod * mul) % mod;
          }
        }
      }
      for (int j = k + 1; j < N; j++) res[j] = 0;
      cur += 1ll << it;
    }
    for (int j = 0; j < N; j++)
      tmp[j] = Complex(a[j] * power(pw[j], 1 << it) % mod % B, 0);
    FFT(tmp, N, t1[0], 0);
    for (int j = 0; j < N; j++)
      tmp[j] = Complex(a[j] * power(pw[j], 1 << it) % mod / B, 0);
    FFT(tmp, N, t1[1], 0);
    for (int j = 0; j < N; j++) tmp[j] = Complex(a[j] % B, 0);
    FFT(tmp, N, t2[0], 0);
    for (int j = 0; j < N; j++) tmp[j] = Complex(a[j] / B, 0);
    FFT(tmp, N, t2[1], 0);
    for (int j = 0; j < N; j++) {
      a[j] = 0;
    }
    for (int p = 0; p < 2; p++) {
      for (int q = 0; q < 2; q++) {
        for (int j = 0; j < N; j++) {
          tmp[j] = t1[p][j] * t2[q][j];
        }
        FFT(tmp, N, ttt, 1);
        long long mul = (1ll << (p + q) * 15) % mod;
        for (int j = 0; j < N; j++) {
          a[j] = (a[j] + (long long)(ttt[j].x + 0.5) % mod * mul) % mod;
        }
      }
    }
    for (int j = k + 1; j < N; j++) {
      a[j] = 0;
    }
  }
  long long ans = 0;
  for (int i = 0; i <= k; i++) {
    ans = (ans + res[i] * fac[i] % mod * C(k, i)) % mod;
  }
  printf("%lld\n", ans);
  return 0;
}
