#include<bits/stdc++.h> #define int long long usingnamespace std; unordered_map<int, int> mp; constlonglong mod = 1e9 + 7; longlongksm(longlong a, longlong x) { longlong ret = 1 % mod; while (x) { if (x & 1) ret = ret * a % mod; a = a * a % mod; x >>= 1; } return ret; } intf(int x, int y) { if (y % x > 0) return0; if (x == y) return1; int k = x * mod + y; if (mp.find(k) != mp.end()) return mp[k]; int n = y / x; int ret = ksm(2, n - 1) - 1, i; for (i = 2; i * i <= n; i++) { if (n % i == 0) { ret = (ret - f(i, n) + mod) % mod; if (n / i != i) ret = (ret - f(n / i, n) + mod) % mod; } } return mp[k] = ret; } signedmain() { int x, y; cin >> x >> y; cout << f(x, y); return0; }