#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int MAXN = 30006;
double MPI = acos(-1);
int sil[MAXN];
int pot[MAXN];
int k;
namespace FFT {
int deg, log_deg;
int rev(int a) {
  int wyn = 0;
  for (int i = 0; i < (log_deg); ++i) {
    wyn *= 2;
    wyn += a % 2;
    a /= 2;
  }
  return wyn;
}
void DFT(int strona, vector<complex<double> > &A) {
  vector<complex<double> > AD(deg);
  for (int k = 0; k < (deg); ++k) AD[rev(k)] = A[k];
  int m = 1;
  for (int s = 1; s <= log_deg; s++) {
    double ang = strona * MPI / m;
    for (int j = 0; j < (m); ++j) {
      complex<double> po = polar(1.0, ang * j);
      for (int k = j; k < deg; k += 2 * m) {
        complex<double> t = po * AD[k + m];
        complex<double> u = AD[k];
        AD[k] = u + t;
        AD[k + m] = u - t;
      }
    }
    m *= 2;
  }
  swap(A, AD);
}
inline vector<int> FFT(const vector<int> AV, const vector<int> BV) {
  vector<int> CV;
  int n = max(AV.size(), BV.size());
  log_deg = 1;
  while ((1 << log_deg) < n) log_deg++;
  log_deg++;
  deg = 1 << log_deg;
  vector<complex<double> > A(deg), B(deg), C(deg);
  for (int i = 0; i < (AV.size()); ++i) A[i] = AV[i];
  for (int i = 0; i < (BV.size()); ++i) B[i] = BV[i];
  DFT(1, A);
  DFT(1, B);
  for (int i = 0; i < (deg); ++i) C[i] = A[i] * B[i];
  DFT(-1, C);
  CV.resize(deg);
  for (int i = 0; i < (deg); ++i)
    CV[i] = ((long long)round(real(C[i]) / deg)) % mod;
  return CV;
}
vector<int> mnoz(vector<int> A, vector<int> B, int prawy) {
  int p = 1;
  for (int i = 0; i < (A.size()); ++i) {
    A[i] = 1LL * A[i] * p % mod;
    p = 1LL * p * pot[prawy] % mod;
  }
  int SQ = 34000;
  vector<int> A1(k), B1(k), C;
  for (int i = 0; i < (k); ++i) A1[i] = A[i] % SQ;
  for (int i = 0; i < (k); ++i) B1[i] = B[i] % SQ;
  vector<int> ret = FFT(A1, B1);
  ret.resize(k);
  for (int i = 0; i < (k); ++i) A1[i] = A[i] / SQ;
  for (int i = 0; i < (k); ++i) B1[i] = B[i] % SQ;
  C = FFT(A1, B1);
  for (int i = 0; i < (k); ++i) ret[i] = (ret[i] + 1LL * C[i] * SQ) % mod;
  for (int i = 0; i < (k); ++i) A1[i] = A[i] % SQ;
  for (int i = 0; i < (k); ++i) B1[i] = B[i] / SQ;
  C = FFT(A1, B1);
  for (int i = 0; i < (k); ++i) ret[i] = (ret[i] + 1LL * C[i] * SQ) % mod;
  for (int i = 0; i < (k); ++i) A1[i] = A[i] / SQ;
  for (int i = 0; i < (k); ++i) B1[i] = B[i] / SQ;
  C = FFT(A1, B1);
  for (int i = 0; i < (k); ++i)
    ret[i] = (ret[i] + 1LL * C[i] * SQ % mod * SQ) % mod;
  return ret;
}
}  // namespace FFT
vector<int> jeden;
vector<int> licz(int n) {
  if (n == 0) {
    vector<int> ans(k, 0);
    ans[0] = 1;
    return ans;
  }
  vector<int> A = licz(n / 2);
  A = FFT::mnoz(A, A, n / 2);
  if (n % 2) A = FFT::mnoz(A, jeden, 1);
  return A;
}
int qp(int a, int b) {
  if (b == 0) return 1;
  int second = qp(a, b / 2);
  second = 1LL * second * second % mod;
  if (b % 2) second = 1LL * second * a % mod;
  return second;
}
int newton(int n, int kk) {
  int mia = 1LL * sil[kk] * sil[n - kk] % mod;
  return 1LL * sil[n] * qp(mia, mod - 2) % mod;
}
int main() {
  sil[0] = 1;
  for (int i = 0; i < (MAXN); ++i)
    if (i) sil[i] = 1LL * i * sil[i - 1] % mod;
  pot[0] = 1;
  for (int i = 0; i < (MAXN); ++i)
    if (i) pot[i] = 2LL * pot[i - 1] % mod;
  long long n;
  scanf("%lld%d", &n, &k);
  if (n > k) {
    puts("0");
    return 0;
  }
  ++k;
  jeden.resize(k);
  for (int i = 0; i < (k); ++i)
    if (i) jeden[i] = qp(sil[i], mod - 2);
  vector<int> wyn = licz(n);
  long long ret = 0;
  for (int i = 0; i < (k); ++i)
    ret += 1LL * wyn[i] * sil[i] % mod * newton(k - 1, i) % mod;
  printf("%lld\n", ret % mod);
  return 0;
}
