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  
    
#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char ch = getchar();
  long long nega = 1;
  while (!isdigit(ch)) {
    if (ch == '-') nega = -1;
    ch = getchar();
  }
  long long ans = 0;
  while (isdigit(ch)) {
    ans = ans * 10 + ch - 48;
    ch = getchar();
  }
  if (nega == -1) return -ans;
  return ans;
}
vector<long long> rev, rt, one(1, 1), zer;
namespace Poly {
inline long long add(long long x, long long y) {
  return x + y >= 31525197391593473LL ? x + y - 31525197391593473LL : x + y;
}
inline long long add(long long x, long long y, long long z) {
  return add(add(x, y), z);
}
inline long long sub(long long x, long long y) {
  return x - y < 0 ? x - y + 31525197391593473LL : x - y;
}
inline long long mul(long long x, long long y) {
  return (__int128)x * y % 31525197391593473LL;
}
inline long long mul(long long x, long long y, long long z) {
  return mul(mul(x, y), z);
}
long long qpow(long long x, long long y) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans = mul(ans, x);
    x = mul(x, x);
    y >>= 1;
  }
  return ans;
}
long long getInv(long long x) { return qpow(x, 31525197391593473LL - 2); }
long long __inv[2000005];
const long long G = 3;
void Init_Inv() {
  __inv[0] = __inv[1] = 1;
  for (long long i = 2; i <= 2000000; i++)
    __inv[i] = mul(31525197391593473LL - 31525197391593473LL / i,
                   __inv[31525197391593473LL % i]);
}
void init(long long B) {
  long long n = 1 << B;
  rev.resize(n), rt.resize(n);
  for (long long i = 1; i < n; i++)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (B - 1));
  for (long long mid = 1; mid < n; mid <<= 1) {
    long long w = qpow(G, (31525197391593473LL - 1) / (mid << 1));
    rt[mid] = 1;
    for (long long i = 1; i < mid; i++) rt[mid + i] = mul(rt[mid + i - 1], w);
  }
}
void NTT(vector<long long> &a, long long B) {
  long long n = 1 << B;
  for (long long i = 0; i < n; i++)
    if (rev[i] > i) swap(a[i], a[rev[i]]);
  for (long long mid = 1; mid < n; mid <<= 1) {
    for (long long i = 0; i < n; i += (mid << 1)) {
      for (long long j = 0; j < mid; j++) {
        long long x = a[i + j], y = mul(a[i + j + mid], rt[j + mid]);
        a[i + j] = add(x, y), a[i + j + mid] = sub(x, y);
      }
    }
  }
}
vector<long long> Mul(vector<long long> a, vector<long long> b) {
  long long B = 0, n = a.size() + b.size() - 1;
  while ((1 << B) < n) B++;
  a.resize(1 << B), b.resize(1 << B);
  init(B);
  NTT(a, B), NTT(b, B);
  for (long long i = 0; i < (1 << B); i++) a[i] = mul(a[i], b[i]);
  reverse(a.begin() + 1, a.end());
  NTT(a, B);
  a.resize(n);
  long long In = getInv(1 << B);
  for (long long i = 0; i < n; i++) a[i] = mul(a[i], In);
  return a;
}
};  // namespace Poly
long long n, m, mod;
inline long long add(long long x, long long y) {
  return x + y >= mod ? x + y - mod : x + y;
}
inline long long add(long long x, long long y, long long z) {
  return add(add(x, y), z);
}
inline long long sub(long long x, long long y) {
  return x - y < 0 ? x - y + mod : x - y;
}
inline long long mul(long long x, long long y) { return 1LL * x * y % mod; }
inline long long mul(long long x, long long y, long long z) {
  return mul(mul(x, y), z);
}
vector<long long> _QAQ;
vector<long long> operator*(vector<long long> x, vector<long long> y) {
  vector<long long> a(x.size()), b(y.size());
  for (long long i = 0; i < (long long)x.size(); i++) a[i] = x[i];
  for (long long i = 0; i < (long long)y.size(); i++) b[i] = y[i];
  vector<long long> r = Poly::Mul(a, b);
  vector<long long> ans(r.size());
  for (long long i = 0; i < (long long)r.size(); i++) ans[i] = r[i] % mod;
  if ((long long)ans.size() > n + 1) ans.resize(n + 1);
  return ans;
}
vector<long long> operator+(vector<long long> a, vector<long long> b) {
  long long n = max(a.size(), b.size());
  a.resize(n), b.resize(n);
  for (long long i = 0; i < n; i++) a[i] = add(a[i], b[i]);
  return a;
}
vector<long long> operator-(vector<long long> a, vector<long long> b) {
  long long n = max(a.size(), b.size());
  a.resize(n), b.resize(n);
  for (long long i = 0; i < n; i++) a[i] = sub(a[i], b[i]);
  return a;
}
vector<long long> a[200], b[200];
long long cnt;
map<long long, long long> vis;
void print(vector<long long> v) {
  cout << "-- ";
  for (long long i : v) printf("%d ", i);
  cout << "\n";
}
long long solve(long long x) {
  if (vis[x]) return vis[x];
  vis[x] = ++cnt;
  long long cur = cnt;
  if (x == 0) {
    a[cur] = b[cur] = zer;
    return cur;
  }
  long long V = solve(x / 2);
  vector<long long> A = a[V], B = b[V];
  if (x % 2 == 0) {
    if ((x / 2) & 1)
      a[cur] = A + (A + B + one) * B, b[cur] = B + (A + B + one) * A;
    else
      a[cur] = A + (A + B + one) * A, b[cur] = B + (A + B + one) * B;
  } else {
    long long R = solve(x - 1);
    vector<long long> A = a[R], B = b[R];
    if (x & 1)
      B = B + (A + B + one) * _QAQ;
    else
      A = A + (A + B + one) * _QAQ;
    a[cur] = A, b[cur] = B;
  }
  return cur;
}
signed main() {
  Poly::Init_Inv();
  _QAQ.resize(2);
  _QAQ[1] = 1;
  zer.resize(1);
  cin >> n >> m >> mod;
  long long ans = 0;
  for (long long i = 2; i <= m; i *= 2) {
    long long pl = solve(m / i);
    for (long long i = 1; i < (long long)b[pl].size(); i += 2)
      ans = add(ans, b[pl][i]);
  }
  cout << ans << endl;
  return 0;
}
