#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int maxn = 65536;
inline int read() {
  char c = getchar();
  int out = 0;
  while (!(c >= '0' && c <= '9')) c = getchar();
  while (c >= '0' && c <= '9') out = out * 10 + c - '0', c = getchar();
  return out;
}
inline int add(int a, int b) {
  if ((a += b) >= mod) a -= mod;
  return a;
}
inline void add_(int &a, int b) {
  if ((a += b) >= mod) a -= mod;
}
inline int dec(int a, int b) {
  if ((a -= b) < 0) a += mod;
  return a;
}
inline void dec_(int &a, int b) {
  if ((a -= b) < 0) a += mod;
}
inline int mult(int a, int b) {
  long long t = 1ll * a * b;
  if (t >= mod) t %= mod;
  return t;
}
inline int power(int a, int b) {
  int out = 1;
  while (b) {
    if (b & 1) out = mult(out, a);
    a = mult(a, a);
    b >>= 1;
  }
  return out;
}
const long double PI = acos(-1);
class cplx {
 public:
  long double real, imag;
  cplx() { real = imag = 0; }
  cplx(long double x, long double y) { real = x, imag = y; }
  cplx operator+(const cplx &t) const {
    return cplx(real + t.real, imag + t.imag);
  }
  cplx operator-(const cplx &t) const {
    return cplx(real - t.real, imag - t.imag);
  }
  cplx operator*(const cplx &t) const {
    return cplx(real * t.real - imag * t.imag, real * t.imag + imag * t.real);
  }
  cplx operator/(const int &t) const { return cplx(real / t, imag / t); }
};
namespace polynomial {
int up[maxn + 5];
void init_up() {
  up[0] = up[1] = 0;
  for (int i = 1; (1 << i) <= maxn; i++) {
    for (int j = ((1 << (i - 1)) + 1); j <= (1 << i); j++) up[j] = i;
  }
}
int R[maxn];
inline void init_R(int len) {
  for (int i = 0; i < (1 << len); i++)
    R[i] = (R[i >> 1] >> 1) | ((i & 1) << (len - 1));
}
void dft(vector<cplx> &A, int len, int flag, bool reinit = 1) {
  if (reinit) init_R(len);
  for (int i = 0; i < (1 << len); i++)
    if (i < R[i]) swap(A[i], A[R[i]]);
  for (int i = 1; i < (1 << len); i <<= 1) {
    cplx bas(cos(PI / i), flag * sin(PI / i));
    for (int j = 0; j < (1 << len); j += (i << 1)) {
      cplx t(1, 0);
      for (int k = 0; k < i; k++, t = t * bas) {
        cplx nx = A[j + k], ny = A[i + j + k] * t;
        A[j + k] = nx + ny;
        A[i + j + k] = nx - ny;
      }
    }
  }
  if (flag == -1) {
    for (int i = 0; i < (1 << len); i++) A[i] = A[i] / (1 << len);
  }
}
vector<int> Mult(vector<int> A, vector<int> B) {
  int totlen = A.size() + B.size() - 1;
  vector<cplx> Q(A.size()), E(B.size());
  for (int i = 0; i < A.size(); i++) Q[i] = cplx(A[i] >> 15, A[i] & 32767);
  for (int i = 0; i < B.size(); i++) E[i] = cplx(B[i] >> 15, B[i] & 32767);
  int tmp = up[totlen];
  Q.resize(1 << tmp);
  E.resize(1 << tmp);
  dft(Q, tmp, 1, 1);
  dft(E, tmp, 1, 0);
  vector<cplx> c(1 << tmp), d(1 << tmp);
  for (int i = 0; i < (1 << tmp); i++) {
    cplx Q1 = Q[i], Q2 = Q[((1 << tmp) - 1) & ((1 << tmp) - i)], E1 = E[i];
    c[i] = cplx((Q1.real + Q2.real) / 2, (Q1.imag - Q2.imag) / 2) * E1;
    d[i] = cplx((Q1.imag + Q2.imag) / 2, (Q2.real - Q1.real) / 2) * E1;
  }
  dft(c, tmp, -1, 0);
  dft(d, tmp, -1, 0);
  vector<int> ret(1 << tmp);
  for (int i = 0; i < (1 << tmp); i++) {
    long long x = c[i].real + 0.5, y = c[i].imag + 0.5, z = d[i].real + 0.5,
              w = d[i].imag + 0.5;
    ret[i] = add(mult(x % mod, mult(32768, 32768)),
                 add(mult((y + z) % mod, 32768), w % mod));
  }
  ret.resize(totlen);
  return ret;
}
}  // namespace polynomial
using namespace polynomial;
long long n;
int K;
vector<int> calc(vector<int> A, vector<int> B, int n2) {
  int pn = power(2, n2);
  for (int i = 0, t = 1; i <= K; i++, t = mult(t, pn)) A[i] = mult(A[i], t);
  A = Mult(A, B);
  A.resize(K + 1);
  return A;
}
vector<int> f[18];
int fac[30010], ifac[30010];
int main() {
  init_up();
  scanf("%lld%d", &n, &K);
  if (n > K) {
    puts("0");
    return 0;
  }
  fac[0] = 1;
  for (int i = 1; i <= K; i++) fac[i] = mult(fac[i - 1], i);
  ifac[K] = power(fac[K], mod - 2);
  for (int i = K - 1; i >= 0; i--) ifac[i] = mult(ifac[i + 1], i + 1);
  f[0].resize(K + 1);
  for (int i = 1; i <= K; i++) f[0][i] = ifac[i];
  for (int i = 1; (1 << i) <= n; i++)
    f[i] = calc(f[i - 1], f[i - 1], (1 << (i - 1)));
  vector<int> A(K + 1);
  A[0] = 1;
  for (int i = 14; i >= 0; i--)
    if ((n >> i) & 1) A = calc(A, f[i], 1 << i);
  int res = 0;
  for (int i = n; i <= K; i++) res = add(res, mult(A[i], ifac[K - i]));
  printf("%d\n", mult(res, fac[K]));
  return 0;
}
