#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = INF * (long long)INF;
const int mod = 1000 * 1000 * 1000 + 7;
const int MAGIC = 1 << 15;
const int MAGIC2 = MAGIC * MAGIC;
const int MAX = 30 * 1000 + 7;
int multMod(long long a, int b) {
  a %= mod;
  long long res = a * b % mod;
  if (res < 0) res += mod;
  return res;
}
void addMod(int& a, int val) {
  a += val;
  if (a >= mod) a -= mod;
}
struct ComplexDouble {
  double a, b;
  ComplexDouble() : a(0.0), b(0.0) {}
  ComplexDouble(double a, double b) : a(a), b(b) {}
  double real() const { return a; }
  friend ComplexDouble operator+(ComplexDouble z1, const ComplexDouble& z2) {
    return ComplexDouble(z1.a + z2.a, z1.b + z2.b);
  }
  friend ComplexDouble operator-(ComplexDouble z1, const ComplexDouble& z2) {
    return ComplexDouble(z1.a - z2.a, z1.b - z2.b);
  }
  friend ComplexDouble operator*(ComplexDouble z1, const ComplexDouble& z2) {
    return ComplexDouble(z1.a * z2.a - z1.b * z2.b, z1.a * z2.b + z2.a * z1.b);
  }
  ComplexDouble& operator/=(const int& k) {
    a /= k;
    b /= k;
    return *this;
  }
};
const int LEN = 1 << 16;
ComplexDouble PW[LEN];
void fft(ComplexDouble* a, int sza, bool invert) {
  int lg = 0;
  while ((1 << lg) < sza) lg++;
  for (int i = (0); i < (sza); ++i) {
    int x = 0;
    for (int j = (0); j < (lg); ++j) x |= ((i >> j) & 1) << (lg - j - 1);
    if (i < x) swap(a[i], a[x]);
  }
  for (int len = 2; len <= sza; len <<= 1) {
    int diff = LEN / len;
    if (invert) diff = LEN - diff;
    for (int i = 0; i < sza; i += len) {
      int pos = 0;
      for (int j = (0); j < (len >> 1); ++j) {
        ComplexDouble *ptr1 = a + i + j, *ptr2 = a + i + j + (len >> 1);
        ComplexDouble u = *ptr1, v = (*ptr2) * PW[pos];
        *ptr1 = u + v;
        *ptr2 = u - v;
        pos += diff;
        if (pos >= LEN) pos -= LEN;
      }
    }
  }
  if (invert)
    for (int i = (0); i < (sza); ++i) a[i] /= sza;
}
void initFFT() {
  double angle = 2 * PI / LEN;
  for (int i = (0); i < (LEN); ++i) {
    double ca = i * angle;
    PW[i] = ComplexDouble(cos(ca), sin(ca));
  }
}
long long n;
int k;
vector<int> dp1;
int Inv[MAX];
int Power2[MAX];
ComplexDouble A0[LEN], A1[LEN], B0[LEN], B1[LEN];
vector<int> mult(vector<int>& a, vector<int>& b) {
  int lg = 0;
  while ((1 << lg) < (int)((a).size()) + (int)((b).size())) lg++;
  for (int i = (0); i < (1 << lg); ++i) {
    if (i < (int)((a).size())) {
      A0[i] = ComplexDouble(a[i] & 32767, 0);
      A1[i] = ComplexDouble(a[i] >> 15, 0);
    } else
      A0[i] = A1[i] = ComplexDouble(0, 0);
  }
  for (int i = (0); i < (1 << lg); ++i) {
    if (i < (int)((b).size())) {
      B0[i] = ComplexDouble(b[i] & 32767, 0);
      B1[i] = ComplexDouble(b[i] >> 15, 0);
    } else
      B0[i] = B1[i] = ComplexDouble(0, 0);
  }
  fft(A0, 1 << lg, 0);
  fft(A1, 1 << lg, 0);
  fft(B0, 1 << lg, 0);
  fft(B1, 1 << lg, 0);
  for (int i = (0); i < (1 << lg); ++i) {
    ComplexDouble u = A0[i] * B1[i] + A1[i] * B0[i];
    A0[i] = A0[i] * B0[i];
    A1[i] = A1[i] * B1[i];
    B1[i] = u;
  }
  fft(A0, 1 << lg, 1);
  fft(B1, 1 << lg, 1);
  fft(A1, 1 << lg, 1);
  vector<int> res(k + 1);
  for (int i = (0); i < ((int)((res).size())); ++i) {
    res[i] = (long long)(A0[i].real() + 0.5) % mod;
    addMod(res[i], multMod((long long)(B1[i].real() + 0.5), MAGIC));
    addMod(res[i], multMod((long long)(A1[i].real() + 0.5), MAGIC2));
  }
  return res;
}
vector<int> binPowDP(int len) {
  if (len == 1) return dp1;
  if (len & 1) {
    vector<int> P = binPowDP(len - 1);
    for (int i = (0); i < (k + 1); ++i) P[i] = multMod(P[i], Power2[i]);
    return mult(P, dp1);
  }
  vector<int> P = binPowDP(len >> 1), Q = P;
  int curPower2 = 1;
  for (int i = (0); i < (k + 1); ++i) {
    P[i] = multMod(P[i], curPower2);
    curPower2 = multMod(curPower2, Power2[len >> 1]);
  }
  return mult(P, Q);
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  initFFT();
  cin >> n >> k;
  if (n > k) {
    cout << 0;
    return 0;
  }
  Inv[1] = 1;
  for (int i = (2); i < (MAX); ++i) Inv[i] = multMod(mod / i, -Inv[mod % i]);
  Power2[0] = 1;
  for (int i = (1); i < (MAX); ++i) Power2[i] = multMod(Power2[i - 1], 2);
  dp1.resize(k + 1);
  int fInv = 1, f = 1;
  for (int i = (1); i < (k + 1); ++i) {
    f = multMod(f, i);
    fInv = multMod(fInv, Inv[i]);
    dp1[i] = fInv;
  }
  vector<int> res = binPowDP(n);
  int ans = 0;
  fInv = 1;
  for (int i = (k + 1) - 1; i >= (0); --i) {
    if (i < k) fInv = multMod(fInv, Inv[k - i]);
    addMod(ans, multMod(res[i], fInv));
  }
  ans = multMod(ans, f);
  cout << ans;
  return 0;
}
