#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e6 + 3;
long long qpow(long long a, long long b) {
  a %= MOD;
  long long c = 1LL;
  while (b) {
    if (b & 1) c = a * c % MOD;
    a = a * a % MOD;
    b >>= 1;
  }
  return c;
}
void solve(long long n, long long k) {
  if (n < 63 && ((long long)1 << n) < k) {
    printf("1 1\n");
    return;
  }
  long long gc = 0;
  for (long long i = k - 1; i; i /= 2) gc += i / 2;
  long long mu = qpow(2, n);
  long long zi = 1LL;
  for (long long i = 1; i < k; ++i) {
    zi = zi * (mu - i + MOD) % MOD;
    if (mu - i == 0) break;
  }
  long long hh = qpow(2, gc);
  long long ni = qpow(hh, MOD - 2);
  mu = qpow(mu, k - 1) * ni % MOD;
  zi = zi * ni % MOD;
  printf("%lld %lld\n", (mu - zi + MOD) % MOD, mu);
}
int main(int argc, char const *argv[]) {
  long long n, k;
  while (scanf("%lld%lld", &n, &k) != -1) solve(n, k);
  return 0;
}
