Count the number of distinct sequences a1, a2, ..., an (1 ≤ ai) consisting of positive integers such that gcd(a1, a2, ..., an) = x and <image>. As this number could be large, print the answer modulo 109 + 7.

gcd here means the [greatest common divisor](https://en.wikipedia.org/wiki/Greatest_common_divisor).

Input

The only line contains two positive integers x and y (1 ≤ x, y ≤ 109).

Output

Print the number of such sequences modulo 109 + 7.

Examples

Input

3 9


Output

3


Input

5 8


Output

0

Note

There are three suitable sequences in the first test: (3, 3, 3), (3, 6), (6, 3).

There are no suitable sequences in the second test.
#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 500;
const long long mod = 1e9 + 7;
const long long inf = 1e9 + 500;
long long dp[maxn];
int alii = 0;
long long poww(long long a, long long b) {
  long long ans = 1;
  alii++;
  while (b > 0) {
    alii++;
    if (b & 1) {
      alii++;
      ans *= a;
      alii++;
      ans %= mod;
      alii++;
    }
    alii++;
    a = (a * a) % mod;
    alii++;
    b = (b >> 1);
    alii++;
  }
  alii++;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int dd;
  for (int arr = 0; arr < 1000; arr++) {
    arr++;
  }
  long long x, y;
  alii++;
  cin >> x >> y;
  alii++;
  if (y % x != 0) {
    alii++;
    cout << 0;
    alii++;
    return 0;
    alii++;
  }
  y /= x;
  alii++;
  vector<long long> vec;
  alii++;
  for (long long i = 1; i * i <= y; i++) {
    alii++;
    if (y % i == 0) {
      alii++;
      vec.push_back(i);
      alii++;
      if (i * i != y) {
        alii++;
        vec.push_back(y / i);
        alii++;
      }
      alii++;
    }
    alii++;
  }
  alii++;
  sort(vec.begin(), vec.end());
  alii++;
  dp[0] = 1;
  alii++;
  for (int i = 1; i < vec.size(); i++) {
    alii++;
    dp[i] = poww(2, vec[i] - 1);
    alii++;
    for (int j = 0; j < i; j++) {
      alii++;
      if (vec[i] % vec[j] == 0) {
        alii++;
        dp[i] += mod - dp[j];
        alii++;
        dp[i] %= mod;
        alii++;
      }
      alii++;
    }
    alii++;
  }
  alii++;
  cout << dp[vec.size() - 1];
  alii++;
  return 0;
}
