#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long n, k;
long long rev_2;
long long bit[65];
inline long long quickpow(long long a, long long b, long long MOD) {
  long long s = 1;
  while (b) {
    if (b & 1) s = (s * a) % MOD;
    a = (a * a) % MOD;
    b >>= 1;
  }
  return s;
}
int main() {
  rev_2 = quickpow(2, 1000003 - 2, 1000003);
  bit[0] = 1;
  for (int i = 1; i < 63; i++) bit[i] = bit[i - 1] << 1;
  n = read();
  k = read();
  if (n <= 60 && k > bit[n]) {
    puts("1 1");
    return 0;
  }
  if (k == 1) {
    puts("0 1");
    return 0;
  }
  long long mx = quickpow(2, n, 1000003), now = mx;
  long long ans1 = 1, ans2 = 1;
  long long te = k - 1, sum = n;
  while (te) {
    sum += te / 2;
    te >>= 1;
  }
  long long sv = k;
  for (long long i = 1; i <= min(sv, (long long)1000003); i++) {
    k--;
    ans2 = (ans2 * mx) % 1000003;
    ans1 = (ans1 * now) % 1000003;
    now--;
    if (!now) now += 1000003;
  }
  if (k) {
    while (k % (1000003 - 1) != 0) ans2 = (ans2 * mx) % 1000003, k--;
  }
  ans1 = (ans1 * quickpow(rev_2, sum, 1000003)) % 1000003;
  ans2 = (ans2 * quickpow(rev_2, sum, 1000003)) % 1000003;
  printf("%lld %lld\n", (ans2 - ans1 + 1000003) % 1000003, ans2);
}
