#include <bits/stdc++.h>
using namespace std;
const int mod = 1e6 + 3;
long long powmod(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret = (ret * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ret;
}
int main() {
  long long n, k;
  scanf("%I64d%I64d", &n, &k);
  if (n <= 63 && k > (1LL << n)) {
    puts("1 1");
    return 0;
  }
  k--;
  long long m = 0, mi = 2;
  while (k >= mi) {
    m += k / mi;
    mi <<= 1;
  }
  long long rev = powmod(powmod(2, m), mod - 2);
  long long mother = powmod(powmod(2, n), k) * rev % mod;
  long long mod2 = powmod(2, n);
  long long son = 1;
  if (k >= mod2)
    son = 0;
  else {
    for (int i = 1; i <= k; i++) {
      mod2--;
      son = son * mod2 % mod;
    }
  }
  son = son * rev % mod;
  long long ans = (mother + mod - son) % mod;
  printf("%I64d %I64d\n", ans, mother);
  return 0;
}
