#include <bits/stdc++.h>
using namespace std;
long long cnt, g[16];
int n, m, bin[70005], inv[70005], a[70005], b[70005], c[70005], f[70005];
void mul(int *a, int *b, int *c, int n) {
  if (n <= 8) {
    memset(g, 0, sizeof(g));
    int i, j;
    for (i = 0; i < n; i++)
      for (j = 0; j < n; j++) g[i + j] += (long long)a[i] * b[j];
    for (i = 0; i < (n << 1); i++) c[i] = g[i] % 1000000007;
    return;
  }
  int mid = n >> 1;
  mul(a, b, c, mid);
  mul(a + mid, b + mid, c + n, mid);
  int i, x[mid], y[mid], z[n];
  for (i = 0; i < mid; i++) {
    x[i] = (a[i] + a[i + mid]) % 1000000007;
    y[i] = (b[i] + b[i + mid]) % 1000000007;
  }
  mul(x, y, z, mid);
  for (i = 0; i < n; i++) z[i] -= c[i] + c[i + n];
  for (i = 0; i < n; i++)
    c[i + mid] = ((c[i + mid] + z[i]) % 1000000007 + 1000000007) % 1000000007;
}
int main() {
  scanf("%lld%d", &cnt, &n);
  if (cnt > n) {
    puts("0");
    return 0;
  }
  m = 1;
  while (m <= n) m <<= 1;
  int i, k, x, y;
  bin[0] = 1;
  for (i = 1; i <= cnt; i++) bin[i] = (bin[i - 1] << 1) % 1000000007;
  inv[0] = inv[1] = 1;
  for (i = 2; i < m; i++)
    inv[i] = 1000000007 -
             (long long)inv[1000000007 % i] * (1000000007 / i) % 1000000007;
  for (i = 3; i < m; i++) inv[i] = (long long)inv[i - 1] * inv[i] % 1000000007;
  for (i = 1; i < m; i++) a[i] = inv[i];
  f[0] = 1;
  for (k = 1; k <= cnt; k <<= 1) {
    if (k > 1) {
      x = 1;
      y = bin[k >> 1];
      for (i = 0; i < m; i++, x = (long long)x * y % 1000000007)
        b[i] = (long long)a[i] * x % 1000000007;
      mul(a, b, c, m);
      for (i = 0; i < m; i++) a[i] = c[i];
    }
    if (cnt & k) {
      x = 1;
      y = bin[cnt & k - 1];
      for (i = 0; i < m; i++, x = (long long)x * y % 1000000007)
        b[i] = (long long)a[i] * x % 1000000007;
      mul(f, b, c, m);
      for (i = 0; i < m; i++) f[i] = c[i];
    }
  }
  int ans = 0;
  for (i = 0; i <= n; i++)
    ans = (ans + (long long)f[i] * inv[n - i]) % 1000000007;
  for (i = 2; i <= n; i++) ans = (long long)ans * i % 1000000007;
  printf("%d\n", ans);
  return 0;
}
