Problem: Test data generation is not an easy task! Often, generating big random test cases is not enough to ensure thorough testing of solutions for correctness.

For example, consider a problem from an old Codeforces round. Its input format looks roughly as follows:

The first line contains a single integer n (1 ≤ n ≤ maxn) — the size of the set. The second line contains n distinct integers a1, a2, ..., an (1 ≤ ai ≤ maxa) — the elements of the set in increasing order.

If you don't pay attention to the problem solution, it looks fairly easy to generate a good test case for this problem. Let n = maxn, take random distinct ai from 1 to maxa, sort them... Soon you understand that it's not that easy.

Here is the actual problem solution. Let g be the greatest common divisor of a1, a2, ..., an. Let x = an / g - n. Then the correct solution outputs "Alice" if x is odd, and "Bob" if x is even.

Consider two wrong solutions to this problem which differ from the correct one only in the formula for calculating x.

The first wrong solution calculates x as x = an / g (without subtracting n).

The second wrong solution calculates x as x = an - n (without dividing by g).

A test case is interesting if it makes both wrong solutions output an incorrect answer.

Given maxn, maxa and q, find the number of interesting test cases satisfying the constraints, and output it modulo q.

Input

The only line contains three integers maxn, maxa and q (1 ≤ maxn ≤ 30 000; maxn ≤ maxa ≤ 109; 104 ≤ q ≤ 105 + 129).

Output

Output a single integer — the number of test cases which satisfy the constraints and make both wrong solutions output an incorrect answer, modulo q.

Examples

Input

3 6 100000


Output

4


Input

6 21 100129


Output

154


Input

58 787788 50216


Output

46009

Note

In the first example, interesting test cases look as follows: 
    
    
      
    1              1              1              3  
    2              4              6              2 4 6  
    

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int mod;
struct comp {
  long double x, y;
} A[N], B[N];
comp operator+(const comp& a, const comp& b) {
  return (comp){a.x + b.x, a.y + b.y};
}
comp operator-(const comp& a, const comp& b) {
  return (comp){a.x - b.x, a.y - b.y};
}
comp operator*(const comp& a, const comp& b) {
  return (comp){a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x};
}
const long double Pi = acos(-1.0);
int id[N], l, limit, inv[N], fac[N];
void ad(int& x, int y) { x = (x + y >= mod) ? (x + y - mod) : (x + y); }
int ksm(int x, int t) {
  int tot = 1;
  while (t) {
    if (t & 1) tot = 1ll * tot * x % mod;
    x = 1ll * x * x % mod;
    t /= 2;
  }
  return tot;
}
void DFT(comp* f, int d) {
  for (int i = 0; i < limit; i++)
    if (i < id[i]) swap(f[i], f[id[i]]);
  for (int l = 1; l < limit; l <<= 1) {
    comp wn = (comp){cos(Pi / l), sin(Pi / l)};
    if (!d) wn.y = -wn.y;
    for (int i = 0; i < limit; i += l + l) {
      comp w = (comp){1, 0};
      for (int x = i, y = i + l; x < i + l; x++, y++, w = w * wn) {
        comp a = f[x], b = f[y] * w;
        f[x] = a + b;
        f[y] = a - b;
      }
    }
  }
}
void prepare(int n) {
  l = 0, limit = 1;
  while (limit <= n) limit <<= 1, l++;
  for (int i = 0; i < limit; i++)
    id[i] = ((id[i >> 1] >> 1) | ((i & 1) << (l - 1)));
}
void mul(vector<int>& f, vector<int> g) {
  int n = f.size() + g.size() - 2;
  prepare(n);
  vector<int> h = f;
  f.resize(n + 1);
  h.resize(limit);
  g.resize(limit);
  for (int i = 0; i <= n; i++) f[i] = 0;
  prepare(n);
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++) {
      for (int a = 0; a < limit; a++)
        A[a] = (comp){(i ? (h[a] / 500) : (h[a] % 500)) * 1.0, 0},
        B[a] = (comp){(j ? (g[a] / 500) : (g[a] % 500)) * 1.0, 0};
      DFT(A, 1);
      DFT(B, 1);
      for (int a = 0; a < limit; a++) A[a] = A[a] * B[a];
      DFT(A, 0);
      int t = 1;
      if (i + j == 1) t = 500;
      if (i + j == 2) t = 250000 % mod;
      for (int a = 0; a <= n; a++)
        ad(f[a], ((long long)(A[a].x / limit + 0.5)) % mod * t % mod);
    }
}
void add(vector<int>& f, const vector<int>& g) {
  if (g.size() > f.size()) f.resize(g.size());
  for (int i = 0; i < g.size(); i++) ad(f[i], g[i]);
}
vector<int> f0, f1, g0, g1;
int n, m, ans;
void solve(vector<int>& f0, vector<int>& f1, int m) {
  if (m == 1) {
    f1[1] = 1;
    return;
  }
  int t = m / 2;
  solve(f0, f1, t);
  for (int i = 1; i <= n; i += 2) ad(ans, f1[i]);
  g0 = f0, g1 = f1;
  if (t & 1) {
    add(f0, g1);
    f0[0]++;
    mul(f0, g1);
    add(f0, g0);
    add(f1, g0);
    f1[0]++;
    mul(f1, g0);
    add(f1, g1);
  } else {
    add(f0, g1);
    f0[0]++;
    mul(f0, g0);
    add(f0, g0);
    add(f1, g0);
    f1[0]++;
    mul(f1, g1);
    add(f1, g1);
  }
  f0.resize(n + 1);
  f1.resize(n + 1);
  if (m & 1) {
    for (int i = n; i >= 1; i--) ad(f1[i], f1[i - 1]), ad(f1[i], f0[i - 1]);
    ad(f1[1], 1);
  }
}
int main() {
  scanf("%d %d %d", &n, &m, &mod);
  f0.resize(n + 1);
  f1.resize(n + 1);
  solve(f0, f1, m);
  printf("%d\n", ans);
}