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;
template <typename T1, typename T2>
void chkmin(T1 &x, T2 y) {
  if (x > y) x = y;
}
template <typename T1, typename T2>
void chkmax(T1 &x, T2 y) {
  if (x < y) x = y;
}
template <typename T>
void read(T &x) {
  x = 0;
  char c = getchar();
  T neg = 1;
  while (!isdigit(c)) {
    if (c == '-') neg = -1;
    c = getchar();
  }
  while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
  x *= neg;
}
const int MAXP = 1 << 16;
const int LOG_N = 30;
const double Pi = acos(-1);
int n, m, mod;
struct comp {
  double x, y;
  comp() { x = y = 0; }
  comp(double _x, double _y) {
    x = _x;
    y = _y;
  }
  comp operator+(const comp &rhs) { return comp(x + rhs.x, y + rhs.y); }
  comp operator-(const comp &rhs) { return comp(x - rhs.x, y - rhs.y); }
  comp operator*(const comp &rhs) {
    return comp(x * rhs.x - y * rhs.y, x * rhs.y + y * rhs.x);
  }
} A[MAXP + 5], B[MAXP + 5], C[MAXP + 5], D[MAXP + 5];
int LEN = 1, LOG = 0, rev[MAXP + 5];
void FFT(comp *a, int len, int type) {
  int lg = log2(len);
  for (int i = 0; i < len; i++)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (lg - 1));
  for (int i = 0; i < len; i++)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int i = 2; i <= len; i <<= 1) {
    comp W(cos(2 * Pi / i), type * sin(2 * Pi / i));
    for (int j = 0; j < len; j += i) {
      comp w(1, 0);
      for (int k = 0; k < (i >> 1); k++, w = w * W) {
        comp X = a[j + k], Y = w * a[(i >> 1) + j + k];
        a[j + k] = X + Y;
        a[(i >> 1) + j + k] = X - Y;
      }
    }
  }
  if (type == -1)
    for (int i = 0; i < len; i++) a[i].x = (long long)(a[i].x / len + 0.5);
}
void polymul(int *a, int *b, int *c, int len) {
  for (int i = 0; i < len; i++)
    A[i] = comp(a[i] >> 9, 0), B[i] = comp(a[i] & 511, 0),
    C[i] = comp(b[i] >> 9, 0), D[i] = comp(b[i] & 511, 0);
  FFT(A, len, 1);
  FFT(B, len, 1);
  FFT(C, len, 1);
  FFT(D, len, 1);
  for (int i = 0; i < len; i++) {
    comp t1 = A[i] * C[i], t2 = B[i] * D[i];
    B[i] = A[i] * D[i] + B[i] * C[i];
    A[i] = t1;
    C[i] = t2;
  }
  FFT(A, len, -1);
  FFT(B, len, -1);
  FFT(C, len, -1);
  for (int i = 0; i < len; i++)
    c[i] = (1ll * (long long)(A[i].x) % mod * 262144ll % mod +
            1ll * (long long)(B[i].x) % mod * 512 % mod +
            (long long)(C[i].x) % mod) %
           mod;
}
struct data {
  int a[2][MAXP + 5];
  data() { memset(a, 0, sizeof(a)); }
};
int tmp[3][MAXP + 5];
void merge(data &a, data &b, const int &x) {
  for (int i = 0; i < LEN; i++) tmp[0][i] = (a.a[0][i] + a.a[1][i]) % mod;
  (tmp[0][0] += 1) %= mod;
  polymul(tmp[0], b.a[0], tmp[1], LEN);
  polymul(tmp[0], b.a[1], tmp[2], LEN);
  for (int i = 0; i <= n; i++) {
    if (x & 1)
      a.a[0][i] = (a.a[0][i] + tmp[2][i]) % mod,
      a.a[1][i] = (a.a[1][i] + tmp[1][i]) % mod;
    else
      a.a[0][i] = (a.a[0][i] + tmp[1][i]) % mod,
      a.a[1][i] = (a.a[1][i] + tmp[2][i]) % mod;
  }
}
data d;
int main() {
  scanf("%d%d%d", &n, &m, &mod);
  int ans = 0;
  while (LEN <= n + n) LEN <<= 1;
  int cur = 0;
  for (int i = LOG_N; i; i--) {
    merge(d, d, cur);
    cur <<= 1;
    if (m >> i & 1) {
      for (int j = n; j; j--)
        d.a[1][j] = (d.a[1][j] + d.a[0][j - 1] + d.a[1][j - 1]) % mod;
      (d.a[1][1] += 1) %= mod;
      cur |= 1;
    }
    for (int j = 1; j <= n; j += 2) ans = (ans + d.a[1][j]) % mod;
  }
  printf("%d\n", ans);
  return 0;
}