#include <bits/stdc++.h>
using namespace std;
const int MAXN = 30000;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const long double PI = acos(-1);
template <class T>
void Read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = 0;
  while (c < '0' || '9' < c) {
    if (c == '-') flag = 1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (flag) x = -x;
}
inline int adjust(int v) {
  if (v >= MOD)
    return v - MOD;
  else if (v < 0)
    return v + MOD;
  else
    return v;
}
inline int ksm(int a, int p) {
  int ret = 1;
  while (p) {
    if (p & 1) ret = 1ll * ret * a % MOD;
    a = 1ll * a * a % MOD;
    p >>= 1;
  }
  return ret;
}
struct Complex {
  long double x, y;
  Complex(long double a = 0, long double b = 0) : x(a), y(b) {}
  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 operator*(const Complex &a) const {
    return Complex(x * a.x - y * a.y, x * a.y + y * a.x);
  }
  Complex operator/=(const long double a) {
    x /= a, y /= a;
    return (*this);
  }
  Complex operator*=(const Complex &a) { return (*this) = (*this) * a; }
};
Complex tmp[MAXN * 4];
inline int rev(int x, int n) {
  int ret = 0;
  for (int i = 1; i < n; i <<= 1) {
    ret = (ret << 1) + (x & 1);
    x >>= 1;
  }
  return ret;
}
inline void DFT(Complex *A, int n, int DFT) {
  for (int i = 0; i < n; ++i) tmp[rev(i, n)] = A[i];
  for (int len = 2; len <= n; len <<= 1) {
    Complex wn = Complex(cos(2.0 * PI / len), sin(2.0 * PI / len) * DFT);
    for (int i = 0; i < n; i += len) {
      Complex w = Complex(1, 0);
      for (int j = 0; j < (len >> 1); ++j) {
        Complex s = tmp[i + j], t = w * tmp[i + j + (len >> 1)];
        tmp[i + j] = s + t, tmp[i + j + (len >> 1)] = s - t;
        w *= wn;
      }
    }
  }
  if (DFT == -1)
    for (int i = 0; i < n; ++i) tmp[i] /= (long double)n;
  for (int i = 0; i < n; ++i) A[i] = tmp[i];
}
Complex tA[MAXN * 4], tB[MAXN * 4];
int ret[MAXN + 10];
inline void FFT(int *A, int *B, int *C, int n) {
  fill(ret, ret + n, 0);
  int len = 1;
  while (len < (n << 1)) len <<= 1;
  for (int i = 0; i < n; ++i)
    tA[i] = A[i] & ((1 << 15) - 1), tB[i] = B[i] & ((1 << 15) - 1);
  for (int i = n; i < len; ++i) tA[i] = tB[i] = 0;
  DFT(tA, len, 1), DFT(tB, len, 1);
  for (int i = 0; i < len; ++i) tA[i] *= tB[i];
  DFT(tA, len, -1);
  for (int i = 0; i < n; ++i)
    ret[i] = adjust(ret[i] + ((long long int)(tA[i].x + 0.5)) % MOD);
  for (int i = 0; i < n; ++i)
    tA[i] = A[i] & ((1 << 15) - 1), tB[i] = B[i] >> 15;
  for (int i = n; i < len; ++i) tA[i] = tB[i] = 0;
  DFT(tA, len, 1), DFT(tB, len, 1);
  for (int i = 0; i < len; ++i) tA[i] *= tB[i];
  DFT(tA, len, -1);
  for (int i = 0; i < n; ++i)
    ret[i] =
        adjust(ret[i] + ((long long int)(tA[i].x + 0.5) % MOD << 15) % MOD);
  for (int i = 0; i < n; ++i)
    tA[i] = A[i] >> 15, tB[i] = B[i] & ((1 << 15) - 1);
  for (int i = n; i < len; ++i) tA[i] = tB[i] = 0;
  DFT(tA, len, 1), DFT(tB, len, 1);
  for (int i = 0; i < len; ++i) tA[i] *= tB[i];
  DFT(tA, len, -1);
  for (int i = 0; i < n; ++i)
    ret[i] =
        adjust(ret[i] + ((long long int)(tA[i].x + 0.5) % MOD << 15) % MOD);
  for (int i = 0; i < n; ++i) tA[i] = A[i] >> 15, tB[i] = B[i] >> 15;
  for (int i = n; i < len; ++i) tA[i] = tB[i] = 0;
  DFT(tA, len, 1), DFT(tB, len, 1);
  for (int i = 0; i < len; ++i) tA[i] *= tB[i];
  DFT(tA, len, -1);
  for (int i = 0; i < n; ++i)
    ret[i] = adjust(ret[i] +
                    (((long long int)(tA[i].x + 0.5) % MOD << 15) % MOD << 15) %
                        MOD);
  copy(ret, ret + n, C);
}
long long int n;
int k;
int fac[MAXN + 10], inv[MAXN + 10];
inline void init() {
  fac[0] = 1;
  for (int i = 1; i <= MAXN; ++i) fac[i] = 1ll * fac[i - 1] * i % MOD;
  inv[MAXN] = ksm(fac[MAXN], MOD - 2);
  for (int i = MAXN - 1; i >= 0; --i) inv[i] = 1ll * inv[i + 1] * (i + 1) % MOD;
}
int tF[MAXN + 10];
void getF(int *F, int n) {
  if (!n)
    fill(F, F + k, 0), F[0] = 1;
  else if (n & 1) {
    getF(F, n - 1);
    tF[0] = 0;
    for (int i = 1; i < k; ++i) tF[i] = inv[i];
    for (int i = 0; i < k; ++i) F[i] = 1ll * F[i] * ksm(2, i) % MOD;
    FFT(tF, F, F, k);
  } else {
    getF(F, n >> 1);
    copy(F, F + k, tF);
    for (int i = 0; i < k; ++i)
      tF[i] = 1ll * tF[i] * ksm(2, 1ll * (n >> 1) * i % (MOD - 1)) % MOD;
    FFT(tF, F, F, k);
  }
}
int F[MAXN + 10];
int main() {
  init();
  Read(n), Read(k);
  if (n > k) {
    puts("0");
    return 0;
  } else {
    ++k, getF(F, n);
    int ans = 0;
    for (int i = 0; i < k; ++i)
      F[i] = 1ll * F[i] * fac[k - 1] % MOD * inv[k - 1 - i] % MOD;
    for (int i = 0; i < k; ++i) ans = adjust(ans + F[i]);
    printf("%d\n", ans);
  }
}
