#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000 + 3;
long long pp(long long a, long long b) {
  long long ans = 1;
  a = a % mod;
  while (b > 0) {
    if (b % 2 == 1) ans = ans * a % mod;
    b = b / 2;
    a = a * a % mod;
  }
  return ans % mod;
}
int main() {
  long long i, j, k, m, n, a, b;
  scanf("%lld%lld", &n, &k);
  long long temp = 1;
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    temp *= 2;
    if (temp >= k) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) {
    printf("1 1\n");
    return 0;
  }
  temp = 0;
  if (k - 1 >= mod) {
    long long temp = 0;
    long long kk = k - 1;
    long long p = 2;
    while (p <= kk) {
      temp = (temp + (k - 1) / p);
      p *= 2;
    }
    long long b = pp(2, n);
    temp = pp(2, temp) % mod;
    b = pp(b, k - 1) % mod * pp(temp, mod - 2) % mod;
    printf("%lld %lld\n", b, b);
    return 0;
  }
  temp = 0;
  long long kk = k - 1;
  long long p = 2;
  while (p <= kk) {
    temp = (temp + (k - 1) / p);
    p *= 2;
  }
  long long aa = pp(2, n);
  a = 1;
  b = 1;
  for (int i = 1; i <= k - 1; i++) {
    a = a * (aa - i) % mod;
  }
  long long tt = pp(2, temp);
  a = a * pp(tt, mod - 2) % mod;
  b = pp(2, n);
  b = pp(b, k - 1);
  b = b * pp(tt, mod - 2) % mod;
  a = b - a;
  a = (a + mod) % mod;
  printf("%lld %lld\n", a, b);
  return 0;
}
