#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
T alex(T x) {
  return (x > 0) ? x : -x;
}
template <class T>
void read(T& x) {
  x = 0;
  T f = 1;
  char ch = getchar();
  while ((ch < 48 || ch > 57) && ch != 45) ch = getchar();
  if (ch == 45) f = -1, ch = getchar();
  while (ch >= 48 && ch <= 57) x = x * 10 + ch - 48, ch = getchar();
  x *= f;
}
long long n;
int k;
int f[17][65536];
int fac[65536], inv[65536], pow2[65536];
int power(int a, int b, int p) {
  int s = 1, w = a;
  while (b) {
    if (b & 1) s = (long long)s * w % p;
    w = (long long)w * w % p;
    b >>= 1;
  }
  return s;
}
int getC(int n, int m) {
  return (long long)fac[n] * inv[m] % 1000000007 * inv[n - m] % 1000000007;
}
int l, r[65536], all;
const int M[3] = {1004535809, 998244353, 469762049};
int A[3][65536], B[3][65536];
long long mul(long long x, long long y, long long p) {
  x %= p, y %= p;
  return (x * y - (long long)(((long double)x * y + 0.5) / (long double)p) * p +
          p) %
         p;
}
int getinv(int x, int y) { return power(x, y - 2, y); }
void FFT(int* a, int n, int type, int p) {
  for (int i = (0); i < (n); i++)
    if (i < r[i]) swap(a[i], a[r[i]]);
  for (int i = 1; i < n; i <<= 1) {
    int wn = (type == 1) ? power(3, (p - 1) / i / 2, p)
                         : power(3, p - 1 - (p - 1) / i / 2, p);
    for (int j = 0, del = i << 1; j < n; j += del) {
      int w = 1;
      for (int k = (0); k < (i); k++) {
        int x = a[j + k], y = (long long)w * a[j + k + i] % p;
        a[j + k] = x + y;
        if (a[j + k] >= p) a[j + k] -= p;
        a[j + k + i] = x - y;
        if (a[j + k + i] < 0) a[j + k + i] += p;
        w = (long long)w * wn % p;
      }
    }
  }
  int revn = power(n, p - 2, p);
  if (type == -1)
    for (int i = (0); i < (n); i++) a[i] = (long long)a[i] * revn % p;
}
int CRT(long long x, long long y, long long z) {
  long long _M = (long long)M[0] * M[1],
            _z = (mul((long long)x * M[1], getinv(M[1], M[0]), _M) +
                  (mul((long long)y * M[0], getinv(M[0], M[1]), _M))) %
                 _M;
  return (((z - _z % M[2]) * getinv(_M % M[2], M[2]) % M[2] + M[2]) % M[2] *
              (_M % 1000000007) +
          _z) %
         1000000007;
}
void mul(int* f, int* a, int* b, int idx) {
  memset(A, 0, sizeof(A));
  memset(B, 0, sizeof(B));
  for (int i = (0); i <= (k); i++) {
    A[0][i] = A[1][i] = A[2][i] =
        (long long)a[i] * fac[k - i] % 1000000007 *
        power(2, (long long)i * (1 << idx) % (1000000007 - 1), 1000000007) %
        1000000007;
    B[0][i] = B[1][i] = B[2][i] = (long long)b[i] * fac[k - i] % 1000000007;
  }
  for (int i = (0); i < (3); i++) {
    FFT(A[i], all, 1, M[i]);
    FFT(B[i], all, 1, M[i]);
    for (int k = (0); k < (all); k++)
      A[i][k] = (long long)A[i][k] * B[i][k] % M[i];
    FFT(A[i], all, -1, M[i]);
  }
  for (int i = (0); i <= (k); i++)
    f[i] = (long long)CRT(A[0][i], A[1][i], A[2][i]) * inv[k] % 1000000007 *
           inv[k - i] % 1000000007;
}
int ans[65536];
void print(int* ans) {
  for (int i = (1); i <= (k); i++) printf("%d ", ans[i]);
  printf("\n");
}
int main() {
  scanf("%lld\n", &n);
  read(k);
  if (n > k) {
    printf("%d\n", 0);
    return 0;
  }
  fac[0] = 1;
  for (int i = (1); i < (65536); i++)
    fac[i] = (long long)fac[i - 1] * i % 1000000007;
  inv[65536 - 1] = power(fac[65536 - 1], 1000000007 - 2, 1000000007);
  for (int i = (65536 - 2); i >= (0); i--)
    inv[i] = (long long)inv[i + 1] * (i + 1) % 1000000007;
  pow2[0] = 1;
  for (int i = (1); i < (65536); i++) pow2[i] = pow2[i - 1] * 2 % 1000000007;
  for (l = 0, all = 1; all <= 2 * k; all <<= 1) l++;
  for (int i = (0); i < (all); i++)
    r[i] = (r[i >> 1] >> 1) | ((i & 1) << (l - 1));
  for (int i = (1); i <= (k); i++) f[0][i] = getC(k, i);
  int log = (int)log2(n);
  for (int i = (1); i <= (log); i++) mul(f[i], f[i - 1], f[i - 1], i - 1);
  memset(ans, 0, sizeof(ans));
  ans[0] = 1;
  for (int i = 0; i <= log; i++, n >>= 1)
    if (n & 1) mul(ans, ans, f[i], i);
  int res = 0;
  for (int i = (1); i <= (k); i++) (res += ans[i]) %= 1000000007;
  printf("%d\n", res);
  return 0;
}
