#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  long long x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(long long a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void writeln(long long a) {
  write(a);
  puts("");
}
inline void wri(long long a) {
  write(a);
  putchar(' ');
}
inline unsigned long long rnd() {
  return ((unsigned long long)rand() << 30 ^ rand()) << 4 | rand() % 4;
}
const int N = 100005, mod = 1e9 + 7;
long long ans[N], sum[N];
int phi[N], pr[N / 10];
bitset<N> heshu;
long long ksm(long long a, int b) {
  long long ans = 1;
  for (; b; b >>= 1) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
  }
  return ans;
}
int main() {
  int n = read(), k = read();
  phi[1] = 1;
  for (int i = (int)(2); i <= (int)(n); i++) {
    if (!heshu[i]) {
      phi[i] = i - 1;
      pr[++*pr] = i;
    }
    for (int j = 1; j <= *pr && i * pr[j] <= n; j++) {
      int k = i * pr[j];
      heshu[k] = 1;
      if (i % pr[j] == 0) {
        phi[k] = phi[i] * pr[j];
        break;
      } else
        phi[k] = phi[i] * (pr[j] - 1);
    }
  }
  for (int i = (int)(2); i <= (int)(n); i++) sum[i] = sum[i - 1] + phi[i];
  for (int i = (int)(0); i <= (int)(n - 1); i++) ans[i] = n - i - 1;
  for (int d = (int)(1); d <= (int)(n - 1); d++) {
    int x = (n + d - 1) / d;
    ans[d] += sum[x];
    ans[x * d - n] -= phi[x];
  }
  long long tot = 0, dq = 1;
  for (int i = (int)(0); i <= (int)(n - 1); i++) {
    tot = (tot + ans[i] % mod * dq) % mod;
    dq = dq * k % mod;
  }
  cout << tot * ksm(k, mod - 1 - n) % mod << endl;
}

### Prompt

Please create a solution in cpp to the following 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.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  long long x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(long long a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void writeln(long long a) {
  write(a);
  puts("");
}
inline void wri(long long a) {
  write(a);
  putchar(' ');
}
inline unsigned long long rnd() {
  return ((unsigned long long)rand() << 30 ^ rand()) << 4 | rand() % 4;
}
const int N = 100005, mod = 1e9 + 7;
long long ans[N], sum[N];
int phi[N], pr[N / 10];
bitset<N> heshu;
long long ksm(long long a, int b) {
  long long ans = 1;
  for (; b; b >>= 1) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
  }
  return ans;
}
int main() {
  int n = read(), k = read();
  phi[1] = 1;
  for (int i = (int)(2); i <= (int)(n); i++) {
    if (!heshu[i]) {
      phi[i] = i - 1;
      pr[++*pr] = i;
    }
    for (int j = 1; j <= *pr && i * pr[j] <= n; j++) {
      int k = i * pr[j];
      heshu[k] = 1;
      if (i % pr[j] == 0) {
        phi[k] = phi[i] * pr[j];
        break;
      } else
        phi[k] = phi[i] * (pr[j] - 1);
    }
  }
  for (int i = (int)(2); i <= (int)(n); i++) sum[i] = sum[i - 1] + phi[i];
  for (int i = (int)(0); i <= (int)(n - 1); i++) ans[i] = n - i - 1;
  for (int d = (int)(1); d <= (int)(n - 1); d++) {
    int x = (n + d - 1) / d;
    ans[d] += sum[x];
    ans[x * d - n] -= phi[x];
  }
  long long tot = 0, dq = 1;
  for (int i = (int)(0); i <= (int)(n - 1); i++) {
    tot = (tot + ans[i] % mod * dq) % mod;
    dq = dq * k % mod;
  }
  cout << tot * ksm(k, mod - 1 - n) % mod << endl;
}

```