#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, mod = 1e9 + 7;
int n, bit, fac[N], inv[N];
long long m, g[32];
int a[N], b[N], c[N], f[N];
inline void add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
inline int pls(int x, int y) {
  x += y;
  return x >= mod ? x - mod : x;
}
inline void dec(int &x, int y) {
  x -= y;
  if (x < 0) x += mod;
}
inline long long qpow(long long a, long long b) {
  long long res = 1;
  for (; b; b >>= 1, a = a * a % mod)
    if (b & 1) res = res * a % mod;
  return res;
}
inline void init(int n) {
  fac[0] = inv[0] = 1;
  for (int i = 1; i <= n; i++)
    fac[i] = 1ll * fac[i - 1] * i % mod, inv[i] = qpow(fac[i], mod - 2);
}
inline void mul(int *a, int *b, int *c, int n) {
  if (n <= 16) {
    for (int i = 0; i < 2 * n; i++) g[i] = 0;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) g[i + j] += 1ll * a[i] * b[j];
    for (int i = 0; i < 2 * n; i++) c[i] = g[i] % mod;
    return;
  }
  int mid = (n >> 1);
  mul(a, b, c, mid);
  mul(a + mid, b + mid, c + n, mid);
  int A[mid], B[mid], C[N];
  for (int i = 0; i < mid; i++)
    A[i] = pls(a[i], a[i + mid]), B[i] = pls(b[i], b[i + mid]);
  mul(A, B, C, mid);
  for (int i = 0; i < n; i++) dec(C[i], c[i]), dec(C[i], c[i + n]);
  for (int i = 0; i < n; i++) add(c[i + mid], C[i]);
}
int main() {
  cin >> m >> n;
  if (m > n) {
    puts("0");
    return 0;
  }
  bit = 1;
  while (bit <= n) bit <<= 1;
  init(n);
  for (int i = 1; i <= n; i++) a[i] = inv[i];
  f[0] = 1;
  for (int k = 1; k <= m; k <<= 1) {
    if (k > 1) {
      int x = 1, y = qpow(2, k >> 1);
      for (int i = 0; i <= n; i++) {
        b[i] = 1ll * a[i] * x % mod;
        x = 1ll * x * y % mod;
      }
      mul(a, b, c, bit);
      for (int i = 0; i <= n; i++) a[i] = c[i];
    }
    if (m & k) {
      int x = 1, y = qpow(2, m & (k - 1));
      for (int i = 0; i <= n; i++) {
        b[i] = 1ll * a[i] * x % mod;
        x = 1ll * x * y % mod;
      }
      mul(f, b, c, bit);
      for (int i = 0; i <= n; i++) f[i] = c[i];
    }
  }
  int ans = 0;
  for (int i = 0; i <= n; i++)
    ans = (ans + 1ll * f[i] * inv[n - i] % mod * fac[n] % mod) % mod;
  cout << ans;
  return 0;
}
