#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1.01e9;
const double eps = 1e-9;
const int mod = (int)1e9 + 7;
int mpow(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) res = (res * (long long)a) % mod;
    a = (a * (long long)a) % mod;
    b >>= 1;
  }
  return res;
}
inline int rev(int a, int m = mod) {
  if (a == 1) return 1;
  return m + (1 - rev(m % a, a) * (long long)m) / a;
}
struct num {
  double x, y;
  num() {}
  num(double xx, double yy) : x(xx), y(yy) {}
};
inline num operator+(num a, num b) { return num(a.x + b.x, a.y + b.y); }
inline num operator-(num a, num b) { return num(a.x - b.x, a.y - b.y); }
inline num operator*(num a, num b) {
  return num(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x);
}
const int BASE = 16;
const int T = 1 << BASE;
int revv[T];
num roots[T];
void fft(num *f) {
  for (int i = 0; (i) < (T); ++i)
    if (i < revv[i]) swap(f[i], f[revv[i]]);
  for (int k = 1; k < T; k <<= 1)
    for (int i = 0; i < T; i += 2 * k)
      for (int j = 0; (j) < (k); ++j) {
        num z = f[i + j + k] * roots[j + k];
        f[i + j + k] = f[i + j] - z;
        f[i + j] = f[i + j] + z;
      }
}
const double PI = acos(-1);
inline num conj(num a) { return num(a.x, -a.y); }
void precalc() {
  for (int i = 1; i < T; ++i)
    revv[i] = (revv[i >> 1] >> 1) + ((i & 1) << (BASE - 1));
  int TT = T >> 1;
  for (int i = 0; (i) < (TT); ++i)
    roots[TT + i] = num(cos(2 * i * PI / T), sin(2 * i * PI / T));
  for (int i = TT - 1; i >= 1; --i) roots[i] = roots[2 * i];
}
const int maxn = (int)1e5 + 10;
int N;
int A[maxn];
int B[maxn];
int C[maxn];
int tmp[maxn];
num f[T], g[T], ff[T], gg[T];
void mult() {
  memset(C, 0, sizeof C);
  for (int i = 0; (i) < (T); ++i) f[i] = num(0, 0);
  for (int i = 0; (i) < (T); ++i) g[i] = num(0, 0);
  for (int i = 0; (i) < (T); ++i) ff[i] = num(0, 0);
  for (int i = 0; (i) < (T); ++i) gg[i] = num(0, 0);
  for (int i = 0; (i) < (N); ++i)
    f[i] = num(A[i] & ((1LL << (15)) - 1), A[i] >> 15);
  for (int i = 0; (i) < (N); ++i)
    g[i] = num(B[i] & ((1LL << (15)) - 1), B[i] >> 15);
  fft(f), fft(g);
  for (int i = 0; (i) < (T); ++i) {
    int j = (T - i) & (T - 1);
    num a1 = (f[i] + conj(f[j])) * num(0.5, 0);
    num a2 = (f[i] - conj(f[j])) * num(0, -0.5);
    num b1 = (g[i] + conj(g[j])) * num(0.5, 0);
    num b2 = (g[i] - conj(g[j])) * num(0, -0.5);
    ff[j] = a1 * b1 + a1 * b2 * num(0, 1);
    gg[j] = a2 * b1 + a2 * b2 * num(0, 1);
  }
  fft(ff), fft(gg);
  for (int i = 0; (i) < (N); ++i) {
    int v11 = (long long)(ff[i].x / T + 0.5) % mod;
    int v12 = (long long)(ff[i].y / T + 0.5) % mod;
    int v21 = (long long)(gg[i].x / T + 0.5) % mod;
    int v22 = (long long)(gg[i].y / T + 0.5) % mod;
    C[i] = (v11 + (v12 + v21) * (1LL << (15)) + v22 * (1LL << (30))) % mod;
  }
}
int d[maxn];
int fact[maxn];
int rfact[maxn];
void multdd(int shift) {
  for (int i = 0; (i) < (N); ++i) A[i] = d[i];
  int mm = mpow(2, shift);
  int val = 1;
  for (int i = 0; (i) < (N); ++i) {
    B[i] = (d[i] * (long long)val) % mod;
    val = (val * (long long)mm) % mod;
  }
  mult();
  for (int i = 0; (i) < (N); ++i) d[i] = C[i];
}
void multd1() {
  int val = 1;
  for (int i = 0; (i) < (N); ++i) {
    A[i] = d[i] * (long long)val % mod;
    val = val * 2 % mod;
  }
  for (int i = 0; (i) < (N); ++i) B[i] = rfact[i];
  B[0] = 0;
  mult();
  for (int i = 0; (i) < (N); ++i) d[i] = C[i];
}
int main() {
  precalc();
  long long n;
  int k;
  scanf("%I64d%d", &n, &k);
  if (n > k) {
    return 0 * printf("0\n");
  }
  N = k + 1;
  fact[0] = 1;
  for (int i = 1; i < N; ++i) fact[i] = (fact[i - 1] * (long long)i) % mod;
  for (int i = 0; (i) < (N); ++i) rfact[i] = rev(fact[i]);
  d[0] = 1;
  for (int i = 15; i >= 0; --i) {
    multdd(n >> (i + 1));
    if (n & (1LL << (i))) multd1();
  }
  int res = 0;
  for (int i = n; i <= k; ++i)
    res = (res + d[i] * (long long)fact[k] % mod * rfact[k - i]) % mod;
  printf("%d\n", res);
  return 0;
}
