#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1E6 + 3;
long long modExp(long long e, long long n, long long m = MOD) {
  long long ret = 1;
  for (; n; n >>= 1, e = e * e % m)
    if (n & 1) ret = ret * e % m;
  return ret;
}
int main() {
  long long n, k;
  scanf("%I64d%I64d", &n, &k);
  if (n < 60 && (1ll << n) < k)
    puts("1 1");
  else {
    long long cnt = n;
    for (long long t = k - 1; t; cnt += t >>= 1)
      ;
    long long A = 1, tB = modExp(2, n), C = modExp(modExp(2, MOD - 2), cnt);
    long long B = modExp(tB, k) * C % MOD;
    if (k >= MOD)
      A = 0;
    else {
      for (int i = 0; i < k; ++i) A = A * (tB + MOD - i) % MOD;
      A = A * C % MOD;
    }
    printf("%I64d %I64d\n", (B + MOD - A) % MOD, B);
  }
  return 0;
}
