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;
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 wri(long long a) {
  write(a);
  putchar(' ');
}
inline void writeln(long long a) {
  write(a);
  puts("");
}
struct cp {
  double x, y;
  cp() : x(0), y(0) {}
  cp(double xx, double yy) : x(xx), y(yy) {}
  void operator=(int xx) {
    x = xx;
    y = 0;
  }
};
inline cp operator+(const cp &a, const cp &b) {
  return cp(a.x + b.x, a.y + b.y);
}
inline cp operator-(const cp &a, const cp &b) {
  return cp(a.x - b.x, a.y - b.y);
}
inline cp operator*(const cp &a, const cp &b) {
  return cp(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x);
}
inline cp conj(const cp &a) { return cp(a.x, -a.y); }
const double PI = acos(-1);
const int N = 1 << 16 | 3;
cp omg[N], inv[N], a[N], b[N];
int rev[N];
void init(int n) {
  int len = 0;
  while ((1 << len) < n) len++;
  for (int i = 0; i < n; i++) {
    omg[i] = cp(cos(2 * PI * i / n), sin(2 * PI * i / n));
    inv[i] = conj(omg[i]);
    rev[i] = rev[i >> 1] >> 1 | ((i & 1) << (len - 1));
  }
}
void FFT(cp *a, int flag, int n) {
  cp *dq;
  if (flag)
    dq = omg;
  else
    dq = inv;
  for (int i = 0; i < n; i++)
    if (rev[i] < i) swap(a[i], a[rev[i]]);
  for (int l = 2; l <= n; l *= 2) {
    int m = l / 2;
    for (int p = 0; p < n; p += l) {
      for (int i = p; i < p + m; i++) {
        cp t = dq[n / l * (i - p)] * a[i + m];
        a[i + m] = a[i] - t;
        a[i] = a[i] + t;
      }
    }
  }
  if (!flag) {
    for (int i = 0; i < n; i++) a[i].x /= n;
  }
}
void FFT(cp *a, cp *b, int as, int bs) {
  int cs = as + bs - 1, len = 1;
  while (len < cs) len <<= 1;
  init(len);
  for (int i = as; i < len; i++) a[i] = 0;
  for (int i = bs; i < len; i++) b[i] = 0;
  FFT(a, 1, len);
  FFT(b, 1, len);
  for (int i = 0; i < len; i++) a[i] = a[i] * b[i];
  FFT(a, 0, len);
}
int mod;
void FFT(vector<long long> &a, vector<long long> &b) {
  static cp A[N], B[N];
  int as = a.size(), bs = b.size();
  for (int i = 0; i < as; i++) {
    A[i].x = a[i];
    A[i].y = 0;
  }
  for (int i = 0; i < bs; i++) {
    B[i].x = b[i];
    B[i].y = 0;
  }
  FFT(A, B, as, bs);
  for (int i = 0; i < as; i++) a[i] = (long long)round(A[i].x) % mod;
}
struct alb {
  int ys;
  vector<long long> dp[2];
};
int n, tot, ans;
long long q[100];
alb operator+(alb a, alb b) {
  if (a.ys & 1) {
    swap(b.dp[0], b.dp[1]);
    swap(b.dp[0][0], b.dp[1][0]);
  }
  b.ys = a.ys + b.ys;
  vector<long long> zs(n);
  for (int i = 0; i < n; i++) zs[i] = (a.dp[0][i] + a.dp[1][i]) % mod;
  FFT(b.dp[0], zs);
  for (int i = 0; i < n; i++) zs[i] = (a.dp[0][i] + a.dp[1][i]) % mod;
  FFT(b.dp[1], zs);
  for (int i = 0; i < n; i++) {
    b.dp[1][i] = (b.dp[1][i] - a.dp[0][i]) % mod;
    b.dp[0][i] = (b.dp[0][i] + a.dp[0][i]) % mod;
  }
  return b;
}
void jy(alb &a) {
  a.ys++;
  for (int i = n - 1; i; i--)
    a.dp[1][i] = (a.dp[1][i] + (a.dp[0][i - 1] + a.dp[1][i - 1])) % mod;
}
int main() {
  n = read() + 1;
  long long mx = read();
  mod = read();
  mx /= 2;
  while (mx) {
    q[++tot] = mx;
    mx /= 2;
  }
  alb dq, zs;
  zs.dp[1].resize(n);
  zs.dp[0].resize(n);
  zs.dp[1][1] = 1;
  zs.dp[1][0] = 1;
  zs.ys = 1;
  dq = zs;
  for (int i = tot; i; i--) {
    if (i < tot) {
      dq = dq + dq;
      if (q[i] != 2 * q[i + 1]) jy(dq);
    }
    for (int j = 1; j < n; j += 2) ans = (ans + dq.dp[1][j]) % mod;
  }
  cout << (ans + mod) % mod << endl;
}