#include <bits/stdc++.h>
const int MAXN = 1001000;
const long long MOD = 1000003;
long long fac[MAXN], inv[MAXN], invfac[MAXN];
long long n, k;
long long powmod(long long p, long long k) {
  long long ret = 1;
  for (long long i = 1; i <= k; i <<= 1, p = p * p % MOD)
    if (i & k) ret = ret * p % MOD;
  return ret;
}
long long sum0(long long k) {
  long long ret = 0;
  while (k) ret += k /= 2;
  return ret;
}
long long sum1(long long n, long long k) {
  k = k & -k;
  while (k >>= 1) --n;
  return n;
}
long long C(long long n, long long k) {
  if (n < k) return 0;
  return fac[n] * invfac[k] % MOD * invfac[n - k] % MOD;
}
long long P(long long n, long long k) {
  if (k >= MOD) return 0;
  return C(powmod(2, n), k) * fac[k] % MOD;
}
int main() {
  scanf("%I64d%I64d", &n, &k);
  if (n <= 63 && (k - 1) >> n) {
    puts("1 1");
    return 0;
  }
  invfac[0] = fac[0] = inv[1] = fac[1] = invfac[1] = 1;
  for (int i = (2); i <= (MOD - 1); ++i)
    inv[i] = (MOD - MOD / i) * inv[MOD % i] % MOD,
    fac[i] = fac[i - 1] * i % MOD, invfac[i] = invfac[i - 1] * inv[i] % MOD;
  long long p = P(n, k), q = powmod(powmod(2, n), k), _s = sum0(k) + sum1(n, k),
            s = powmod(inv[2], _s);
  (p *= s) %= MOD;
  (q *= s) %= MOD;
  p = q - p;
  if (p < 0) p += MOD;
  printf("%I64d %I64d\n", p, q);
  return 0;
}
