#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e6 + 3;
long long n, k;
long long count2(long long n, long long k) {
  long long cur = 2;
  long long ans = 0;
  long long cnt = 0;
  while (cur <= k) {
    ans += k / cur;
    if (k % cur != 0) ans++;
    cur *= 2;
    cnt++;
  }
  return (ans + n - cnt) % (MOD - 1);
}
int bin(int x, int d) {
  if (d == 0) return 1;
  if (d % 2 == 0) {
    int cur = bin(x, d / 2);
    return ((long long)cur * cur) % MOD;
  } else
    return ((long long)bin(x, d - 1) * x) % MOD;
}
int main() {
  scanf("%I64d %I64d", &n, &k);
  if (n < 63 && (1LL << n) < k) {
    cerr << 1;
    printf("1 1");
    return 0;
  }
  long long nn = n % (MOD - 1);
  long long kk = k % (MOD - 1);
  long long den =
      bin(2, ((long long)nn * kk - count2(n, k) + MOD - 1) % (MOD - 1));
  if (k >= MOD) {
    printf("%I64d %I64d", den, den);
    return 0;
  }
  long long pw = bin(2, nn);
  long long ans = 1;
  for (int i = 0; i < k; i++) {
    ans = ((long long)ans * (pw - i + MOD)) % MOD;
  }
  cerr << ans;
  ans = ((long long)ans * bin(bin(2, count2(n, k)), MOD - 2)) % MOD;
  printf("%I64d %I64d", (den - ans + MOD) % MOD, den);
  return 0;
}
