Problem: You are given integers n, k. Let's consider the alphabet consisting of k different elements.

Let beauty f(s) of the string s be the number of indexes i, 1≤ i<|s|, for which prefix of s of length i equals to suffix of s of length i. For example, beauty of the string abacaba equals 2, as for i = 1, 3 prefix and suffix of length i are equal.

Consider all words of length n in the given alphabet. Find the expected value of f(s)^2 of a uniformly chosen at random word. We can show that it can be expressed as P/Q, where P and Q are coprime and Q isn't divided by 10^9 + 7. Output P⋅ Q^{-1} mod 10^9 + 7.

Input

The first and the only line contains two integers n, k (1≤ n ≤ 10^5, 1≤ k≤ 10^9) — the length of a string and the size of alphabet respectively.

Output

Output a single integer — P× Q^{-1} mod 10^9 + 7.

Examples

Input


2 3


Output


333333336


Input


1 5


Output


0


Input


100 1


Output


9801


Input


10 10


Output


412377396

Note

In the first example, there are 9 words of length 2 in alphabet of size 3 — aa, ab, ac, ba, bb, bc, ca, cb, cc. 3 of them have beauty 1 and 6 of them have beauty 0, so the average value is 1/3.

In the third example, there is only one such word, and it has beauty 99, so the average value is 99^2.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const int MOD = 1e9 + 7;
inline void ADD(int& x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
inline void DEC(int& x, int y) {
  x -= y;
  if (x < 0) x += MOD;
}
inline int add(int x, int y) { return x + y < MOD ? x + y : x + y - MOD; }
inline int dec(int x, int y) { return x < y ? x - y + MOD : x - y; }
long long q_pow(long long a, long long b, long long p = MOD) {
  long long ret = 1;
  for (; b; a = a * a % p, b >>= 1)
    if (b & 1) ret = ret * a % p;
  return ret;
}
long long q_inv(long long x, long long p = MOD) { return q_pow(x, p - 2, p); }
template <typename T>
void chkmax(T& x, T y) {
  if (y > x) x = y;
}
template <typename T>
void chkmin(T& x, T y) {
  if (y < x) x = y;
}
int N, K;
vector<int> V[MAXN];
int pr[MAXN], pl, np[MAXN], mu[MAXN], pw[MAXN];
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
int main() {
  scanf("%d%d", &N, &K);
  for (int i = 1; i <= N; ++i)
    for (int j = i; j <= 2 * N; j += i) V[j].push_back(i);
  mu[1] = 1;
  for (int i = 2; i <= N; ++i) {
    if (!np[i]) {
      pr[++pl] = i, mu[i] = -1;
    }
    for (int j = 1; j <= pl && i * pr[j] <= N; ++j) {
      np[i * pr[j]] = 1;
      if (i % pr[j])
        mu[i * pr[j]] = -mu[i];
      else {
        mu[i * pr[j]] = 0;
        break;
      }
    }
  }
  pw[0] = 1;
  for (int i = 1; i <= N; ++i) pw[i] = 1ll * pw[i - 1] * K % MOD;
  int ans = 0;
  for (int d = 1; d <= N - 1; ++d) {
    int m = (N - 1) / d;
    for (int s = 2; s <= 2 * ((N - 1) / d); ++s) {
      int cur = 0;
      for (int t : V[s]) {
        if (t > m) break;
        if (mu[t]) {
          int tmp;
          if (s / t <= m / t + 1)
            tmp = s / t - 1;
          else if (s / t <= 2 * (m / t))
            tmp = m / t - (s / t - (m / t + 1));
          else
            tmp = 0;
          if (mu[t] == 1)
            ADD(cur, tmp);
          else
            DEC(cur, tmp);
        }
      }
      ADD(ans, 1ll * cur * pw[max(d, d * s - N)] % MOD);
    }
  }
  ans = 1ll * ans * q_inv(pw[N]) % MOD;
  printf("%d", ans);
  return 0;
}