#include <bits/stdc++.h>
using namespace std;
const int N = 30005;
const int mo = 1000000007;
int fac[N], inv[N], k;
long long n;
struct node {
  int len, a[N * 2];
};
int power(int x, int y) {
  int s = 1;
  for (; y; y /= 2, x = 1ll * x * x % mo)
    if (y & 1) s = 1ll * s * x % mo;
  return s;
}
void init() {
  fac[0] = inv[0] = inv[1] = 1;
  for (int i = (int)(2); i <= (int)(N - 1); i++)
    inv[i] = 1ll * inv[mo % i] * (mo - mo / i) % mo;
  for (int i = (int)(1); i <= (int)(N - 1); i++)
    inv[i] = 1ll * inv[i - 1] * inv[i] % mo;
  for (int i = (int)(1); i <= (int)(N - 1); i++)
    fac[i] = 1ll * fac[i - 1] * i % mo;
}
int C(int x, int y) { return 1ll * fac[x] * inv[y] % mo * inv[x - y] % mo; }
void Multiply(int *a, int *b, int n, int *c) {
  if (n <= 30) {
    for (int i = (int)(0); i <= (int)(2 * n); i++) c[i] = 0;
    for (int i = (int)(0); i <= (int)(n - 1); i++)
      for (int j = (int)(0); j <= (int)(n - 1); j++)
        c[i + j] = (c[i + j] + 1ll * a[i] * b[j]) % mo;
    return;
  }
  int nn = n / 2;
  int *res1 = new int[n + 3];
  int *res2 = new int[n + 3];
  int *res3 = new int[n + 3];
  int *sa = new int[n + 1];
  int *sb = new int[n + 1];
  for (int i = (int)(nn); i <= (int)(n - 1); i++) {
    sa[i - nn] = a[i];
    sb[i - nn] = b[i];
  }
  for (int i = (int)(0); i <= (int)(nn - 1); i++) {
    sa[i] = (sa[i] + a[i]) % mo;
    sb[i] = (sb[i] + b[i]) % mo;
  }
  Multiply(a, b, nn, res1);
  Multiply(a + nn, b + nn, n - nn, res2);
  Multiply(sa, sb, n - nn, res3);
  for (int i = (int)(0); i <= (int)(2 * n); i++) c[i] = 0;
  for (int i = (int)(0); i <= (int)(2 * (nn - 1)); i++) c[i] = res1[i];
  for (int i = (int)(0); i <= (int)(2 * (n - 1 - nn)); i++)
    c[i + nn * 2] = res2[i];
  for (int i = (int)(0); i <= (int)(2 * (n - 1 - nn)); i++) {
    res3[i] = (res3[i] + 2ll * mo - res1[i] - res2[i]) % mo;
    c[i + nn] = (c[i + nn] + res3[i]) % mo;
  }
  delete[] res1;
  delete[] res2;
  delete[] res3;
  delete[] sa;
  delete[] sb;
}
node merge(node a, node b) {
  node c;
  memset(c.a, 0, sizeof(c.a));
  c.len = a.len + b.len;
  for (int i = (int)(0); i <= (int)(k); i++)
    a.a[i] = 1ll * a.a[i] * power(2, b.len * (i + a.len)) % mo;
  for (int i = (int)(0); i <= (int)(k); i++)
    a.a[i] = 1ll * a.a[i] * inv[i + a.len] % mo;
  for (int i = (int)(0); i <= (int)(k); i++)
    b.a[i] = 1ll * b.a[i] * inv[i + b.len] % mo;
  Multiply(a.a, b.a, k + 1, c.a);
  for (int i = (int)(0); i <= (int)(k); i++)
    c.a[i] = 1ll * c.a[i] * fac[i + c.len] % mo;
  for (int i = (int)(k + 1); i <= (int)(2 * k); i++) c.a[i] = 0;
  return c;
}
node power(node a, int n) {
  node s;
  s.len = 0;
  s.a[0] = 1;
  for (; n; n /= 2, a = merge(a, a))
    if (n & 1) s = merge(s, a);
  return s;
}
int main() {
  init();
  scanf("%lld%d", &n, &k);
  if (n > k) return puts("0"), 0;
  node tmp;
  tmp.len = 1;
  k -= n;
  for (int i = (int)(0); i <= (int)(k); i++) tmp.a[i] = 1;
  tmp = power(tmp, n);
  int ans = 0;
  for (int i = (int)(0); i <= (int)(k); i++)
    ans = (ans + 1ll * C(k + n, i + n) * tmp.a[i]) % mo;
  printf("%d\n", ans);
}

### Prompt

Create a solution in cpp for the following problem:

Let's define the transformation P of a sequence of integers a1, a2, ..., an as b1, b2, ..., bn, where bi = a1 | a2 | ... | ai for all i = 1, 2, ..., n, where | is the bitwise OR operation.

Vasya consequently applies the transformation P to all sequences of length n consisting of integers from 1 to 2k - 1 inclusive. He wants to know how many of these sequences have such property that their transformation is a strictly increasing sequence. Help him to calculate this number modulo 109 + 7.

Input

The only line of the input contains two integers n and k (1 ≤ n ≤ 1018, 1 ≤ k ≤ 30 000).

Output

Print a single integer — the answer to the problem modulo 109 + 7.

Examples

Input

1 2


Output

3


Input

2 3


Output

30


Input

3 3


Output

48

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int N = 30005;
const int mo = 1000000007;
int fac[N], inv[N], k;
long long n;
struct node {
  int len, a[N * 2];
};
int power(int x, int y) {
  int s = 1;
  for (; y; y /= 2, x = 1ll * x * x % mo)
    if (y & 1) s = 1ll * s * x % mo;
  return s;
}
void init() {
  fac[0] = inv[0] = inv[1] = 1;
  for (int i = (int)(2); i <= (int)(N - 1); i++)
    inv[i] = 1ll * inv[mo % i] * (mo - mo / i) % mo;
  for (int i = (int)(1); i <= (int)(N - 1); i++)
    inv[i] = 1ll * inv[i - 1] * inv[i] % mo;
  for (int i = (int)(1); i <= (int)(N - 1); i++)
    fac[i] = 1ll * fac[i - 1] * i % mo;
}
int C(int x, int y) { return 1ll * fac[x] * inv[y] % mo * inv[x - y] % mo; }
void Multiply(int *a, int *b, int n, int *c) {
  if (n <= 30) {
    for (int i = (int)(0); i <= (int)(2 * n); i++) c[i] = 0;
    for (int i = (int)(0); i <= (int)(n - 1); i++)
      for (int j = (int)(0); j <= (int)(n - 1); j++)
        c[i + j] = (c[i + j] + 1ll * a[i] * b[j]) % mo;
    return;
  }
  int nn = n / 2;
  int *res1 = new int[n + 3];
  int *res2 = new int[n + 3];
  int *res3 = new int[n + 3];
  int *sa = new int[n + 1];
  int *sb = new int[n + 1];
  for (int i = (int)(nn); i <= (int)(n - 1); i++) {
    sa[i - nn] = a[i];
    sb[i - nn] = b[i];
  }
  for (int i = (int)(0); i <= (int)(nn - 1); i++) {
    sa[i] = (sa[i] + a[i]) % mo;
    sb[i] = (sb[i] + b[i]) % mo;
  }
  Multiply(a, b, nn, res1);
  Multiply(a + nn, b + nn, n - nn, res2);
  Multiply(sa, sb, n - nn, res3);
  for (int i = (int)(0); i <= (int)(2 * n); i++) c[i] = 0;
  for (int i = (int)(0); i <= (int)(2 * (nn - 1)); i++) c[i] = res1[i];
  for (int i = (int)(0); i <= (int)(2 * (n - 1 - nn)); i++)
    c[i + nn * 2] = res2[i];
  for (int i = (int)(0); i <= (int)(2 * (n - 1 - nn)); i++) {
    res3[i] = (res3[i] + 2ll * mo - res1[i] - res2[i]) % mo;
    c[i + nn] = (c[i + nn] + res3[i]) % mo;
  }
  delete[] res1;
  delete[] res2;
  delete[] res3;
  delete[] sa;
  delete[] sb;
}
node merge(node a, node b) {
  node c;
  memset(c.a, 0, sizeof(c.a));
  c.len = a.len + b.len;
  for (int i = (int)(0); i <= (int)(k); i++)
    a.a[i] = 1ll * a.a[i] * power(2, b.len * (i + a.len)) % mo;
  for (int i = (int)(0); i <= (int)(k); i++)
    a.a[i] = 1ll * a.a[i] * inv[i + a.len] % mo;
  for (int i = (int)(0); i <= (int)(k); i++)
    b.a[i] = 1ll * b.a[i] * inv[i + b.len] % mo;
  Multiply(a.a, b.a, k + 1, c.a);
  for (int i = (int)(0); i <= (int)(k); i++)
    c.a[i] = 1ll * c.a[i] * fac[i + c.len] % mo;
  for (int i = (int)(k + 1); i <= (int)(2 * k); i++) c.a[i] = 0;
  return c;
}
node power(node a, int n) {
  node s;
  s.len = 0;
  s.a[0] = 1;
  for (; n; n /= 2, a = merge(a, a))
    if (n & 1) s = merge(s, a);
  return s;
}
int main() {
  init();
  scanf("%lld%d", &n, &k);
  if (n > k) return puts("0"), 0;
  node tmp;
  tmp.len = 1;
  k -= n;
  for (int i = (int)(0); i <= (int)(k); i++) tmp.a[i] = 1;
  tmp = power(tmp, n);
  int ans = 0;
  for (int i = (int)(0); i <= (int)(k); i++)
    ans = (ans + 1ll * C(k + n, i + n) * tmp.a[i]) % mo;
  printf("%d\n", ans);
}

```