#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e6 + 3;
long long n, k, x;
pair<long long, long long> ans;
long long powmod(long long a, long long b, long long c) {
  long long ans = 1;
  while (b > 0) {
    if (b & 1) ans = ans * a % c;
    a = a * a % c;
    b /= 2;
  }
  return ans;
}
pair<long long, long long> work(long long n, long long k) {
  if (k == 0) {
    return make_pair(0, 1);
  }
  long long dq = powmod(2, n, mod), now = 1;
  for (int i = 1; i < 2 * mod; i += 2) {
    now = now * (dq - i + 2 * mod) % mod;
  }
  long long ans;
  ans = powmod(now, k / (2 * mod), mod);
  for (int i = 1; i <= (k % (2 * mod)); i += 2)
    ans = ans * (dq - i + 2 * mod) % mod;
  pair<long long, long long> cur = work(n - 1, k / 2);
  ans = ans * cur.second % mod;
  return make_pair((k / 2 + cur.first) % (mod - 1), ans);
}
int main() {
  cin >> n >> k;
  x = 0;
  while ((1LL << x) < k) x++;
  if (n < x) {
    cout << "1 1" << endl;
    return 0;
  }
  pair<long long, long long> ans = work(n, k - 1);
  long long fz, fm;
  fz = ans.second;
  fm = (n % (mod - 1)) * ((k - 1) % (mod - 1)) % (mod - 1);
  fm = (fm - ans.first + (mod - 1)) % (mod - 1);
  fm = powmod(2, fm, mod);
  fz = (fm - fz + mod) % mod;
  cout << fz << " " << fm << endl;
  return 0;
}
