#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
void add(int &a, int x) {
  a += x;
  if (a >= mod) a -= mod;
}
int mul(int a, int b) { return (long long)a * b % mod; }
int modpow(int a, int n, int mmod) {
  int res = 1;
  for (; n > 0; n >>= 1) {
    if (n & 1) res = 1LL * res * a % mmod;
    a = 1LL * a * a % mod;
  }
  return res;
}
int inv(int x) { return modpow(x, mod - 2, mod); }
const int N = 1000100;
int fact[N];
int invfact[N];
int C(int n, int k) { return mul(fact[n], mul(invfact[n - k], invfact[k])); }
const int MAX = 1 << 17;
namespace FFT {
const double pi = 2 * acos(0);
int N;
complex<double> omega[MAX];
complex<double> a1[MAX], a2[MAX];
complex<double> z1[MAX], z2[MAX];
long long x[MAX], y[MAX], z[MAX];
void fft(complex<double> *a, complex<double> *z, int m = N) {
  if (m == 1) {
    z[0] = a[0];
  } else {
    int s = N / m;
    m /= 2;
    fft(a, z, m);
    fft(a + s, z + m, m);
    for (int i = (0); i < (m); ++i) {
      complex<double> c = omega[s * i] * z[m + i];
      z[m + i] = z[i] - c;
      z[i] += c;
    }
  }
}
void mult(long long *a, long long *b, long long *c, int len) {
  N = 2 * len;
  while (N & (N - 1)) ++N;
  assert(N <= MAX);
  for (int i = (0); i < (N); ++i) a1[i] = 0;
  for (int i = (0); i < (N); ++i) a2[i] = 0;
  for (int i = (0); i < (len); ++i) a1[i] = a[i];
  for (int i = (0); i < (len); ++i) a2[i] = b[i];
  for (int i = (0); i < (N); ++i) omega[i] = polar(1.0, 2 * pi / N * i);
  fft(a1, z1, N);
  fft(a2, z2, N);
  for (int i = (0); i < (N); ++i) omega[i] = complex<double>(1, 0) / omega[i];
  for (int i = (0); i < (N); ++i) a1[i] = z1[i] * z2[i] / complex<double>(N, 0);
  fft(a1, z1, N);
  for (int i = (0); i < (2 * len); ++i) c[i] = round(z1[i].real());
}
void mult2(vector<int> &a, vector<int> &b, vector<int> &c, int len) {
  const int K = 1 << 15;
  for (int i = (0); i < (2 * len); ++i) x[i] = y[i] = z[i] = 0;
  c.resize(2 * len);
  for (int i = (0); i < (2 * len); ++i) c[i] = 0;
  for (int ca = (0); ca < (2); ++ca)
    for (int cb = (0); cb < (2); ++cb) {
      for (int i = (0); i < (len); ++i) {
        x[i] = ca ? a[i] / K : a[i] % K;
        y[i] = cb ? b[i] / K : b[i] % K;
      }
      mult(x, y, z, len);
      int k = mul(ca ? K : 1, cb ? K : 1);
      for (int i = (0); i < (2 * len); ++i) add(c[i], mul(k, z[i] % mod));
    }
}
}  // namespace FFT
int bits;
vector<int> join(const vector<int> &dpl, const vector<int> &dpr, int len) {
  vector<int> a(bits + 1, 0);
  vector<int> b(bits + 1, 0);
  vector<int> c(bits + 1, 0);
  for (int i = 1; i < bits; i++) {
    a[i] = mul(invfact[i],
               mul(dpl[i], modpow(2, 1LL * i * (len) % (mod - 1), mod)));
    b[i] = mul(dpr[i], invfact[i]);
  }
  FFT::mult2(a, b, c, bits + 1);
  vector<int> res(bits + 1, 0);
  for (int i = 1; i <= bits; i++) res[i] = mul(c[i], fact[i]);
  return res;
}
vector<int> solve(int n) {
  vector<int> res(bits + 1, 0);
  if (n > bits) return res;
  if (n == 1) {
    for (int i = 1; i <= bits; i++) {
      res[i] = 1;
    }
    return res;
  }
  vector<int> l, r;
  if (n & 1) {
    l = solve(n - 1);
    r = solve(1);
    return join(l, r, 1);
  } else {
    l = r = solve(n >> 1);
    return join(l, r, n >> 1);
  }
}
long long n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  fact[0] = invfact[0] = 1;
  for (int i = 1; i < N; i++) {
    fact[i] = mul(i, fact[i - 1]);
    invfact[i] = mul(invfact[i - 1], inv(i));
  }
  cin >> n >> bits;
  double ttime = clock();
  if (n > bits) {
    cout << 0 << endl;
    return 0;
  }
  vector<int> res = solve(n);
  int sol = 0;
  for (int i = 1; i <= bits; i++) add(sol, mul(C(bits, i), res[i]));
  cout << sol << endl;
  cerr << (clock() - ttime) / CLOCKS_PER_SEC << endl;
  return 0;
}
