#include <bits/stdc++.h>
const long long mod = 1e6 + 3;
long long n, k, gyz, fm, fz;
long long QMult(long long a, long long b) {
  long long c = 1;
  while (b) {
    if (b & 1) {
      c = c * a % mod;
    }
    a = a * a % mod;
    b = b >> 1;
  }
  return c;
}
void get_gyz() {
  gyz = 0;
  long long a = 2;
  long long temp = (k - 1) / a;
  gyz += temp;
  while (temp > 0) {
    a = a * 2;
    temp = (k - 1) / a;
    gyz += temp;
  }
}
long long fermat(long long a) {
  long long ans = 1;
  long long b = mod - 2;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
int main() {
  while (~scanf("%I64d%I64d", &n, &k)) {
    get_gyz();
    long long x = QMult(2, gyz);
    x = fermat(x);
    x = (x + mod) % mod;
    fm = QMult(QMult(2, n), k - 1) * x % mod;
    if (k - 1 >= mod)
      fz = 0;
    else {
      fz = 1;
      long long temp = QMult(2, n);
      long long t;
      for (int i = 1; i < k; i++) {
        t = temp - i < 0 ? temp - i + mod : temp - i;
        fz = fz * t % mod;
      }
      fz = fz * x % mod;
    }
    int flag = 0;
    long long temp = 1;
    for (int i = 1; i <= n && i <= 63; i++) {
      temp *= 2;
      if (k <= temp) {
        flag = 1;
      }
    }
    if (flag)
      printf("%I64d %I64d\n", (fm - fz + mod) % mod, fm);
    else
      printf("1 1\n");
  }
  return 0;
}
