#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e6 + 3;
long long n, k;
long long Kmod(long long num, long long pw, int mod) {
  long long base = 1;
  while (pw) {
    if (pw & 1) base = base * num % mod;
    num = num * num % mod;
    pw >>= 1;
  }
  return base;
}
long long Calc(long long x) {
  x >>= 1;
  return x > 0 ? Calc(x) + x : 0;
}
void Solve() {
  cin >> n >> k;
  --k;
  if (n < 64 && (k >> n) > 0) {
    puts("1 1");
    return;
  }
  int range = (n % (MOD - 1) * (k % (MOD - 1))) % (MOD - 1),
      base[3] = {1, 1, 1};
  for (int i = 0; i < range; ++i) base[1] = (base[1] + base[1]) % MOD;
  range = n % (MOD - 1);
  for (int i = 0; i < range; ++i) base[0] = (base[0] + base[0]) % MOD;
  long long inv = Kmod(Kmod(2, MOD - 2, MOD), Calc(k), MOD);
  if (k >= MOD) {
    base[2] = 0;
  } else {
    for (int i = base[0] + MOD - 1; i >= base[0] + MOD - k; --i)
      base[2] = base[2] * 1LL * i % MOD;
  }
  for (int i = 1; i <= 2; ++i) base[i] = base[i] * inv % MOD;
  cout << (base[1] - base[2] + MOD) % MOD << ' ' << base[1] << endl;
}
int main() {
  Solve();
  return 0;
}
