#include <bits/stdc++.h>
using namespace std;
const int mo = 1e6 + 3;
long long n, k, fact2, nums, divs, inv2, tmp;
long long ksm(long long b, long long p) {
  if (p < 2) return p ? b % mo : 1;
  long long t = ksm(b, p >> 1);
  t = t * t % mo;
  return p & 1 ? t * b % mo : t;
}
long long calc(long long x, long long ret = 0) {
  if (x <= 0) return 0;
  for (long long i = 2;; i <<= 1) {
    ret += x / i;
    if ((x >> 1) < i) return ret;
  }
  return ret;
}
int main() {
  cin >> n >> k;
  if (n < 63) {
    if ((1ll << n) < k) return puts("1 1"), 0;
  }
  fact2 = calc(k - 1);
  divs = ksm(2ll, n), divs = ksm(divs, k - 1);
  inv2 = ksm(2ll, mo - 2), divs = divs * ksm(inv2, fact2) % mo;
  nums = 1, tmp = ksm(2ll, n);
  for (int i = 1; i < k; ++i) {
    nums = nums * (tmp - i + mo) % mo;
    if (nums == 0) break;
  }
  nums = nums * ksm(inv2, fact2) % mo;
  printf("%lld %lld\n", (divs - nums + mo) % mo, divs);
  return 0;
}
