#include <bits/stdc++.h>
using namespace std;
long long N, K;
long long pw[1000003];
long long num, denom;
long long no2(long long x) {
  long long a = 0;
  while (x > 0) {
    a += (x / 2);
    x /= 2;
  }
  return a;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  if (fopen("cf711e.in", "r")) {
    freopen("cf711e.in", "r", stdin);
    freopen("cf711e.out", "w", stdout);
  }
  cin >> N >> K;
  pw[0] = 1;
  for (int i = 1; i < 1000003; i++) {
    pw[i] = 2 * pw[i - 1];
    pw[i] %= 1000003;
  }
  for (long long i = 0; i < 60; i++) {
    long long v = (1ll << i);
    if (K > v && N <= i) {
      cout << "1 1\n";
      return 0;
    }
  }
  K--;
  num = 1;
  if (K < 1000003) {
    long long val = pw[(N % 1000002)];
    long long w = val - K;
    for (long long i = w; i < val; i++) {
      num *= i;
      num %= 1000003;
    }
  } else {
    num = 0;
  }
  num += 1000003;
  num %= 1000003;
  long long ex = (N % 1000002) * (K % 1000002);
  ex %= 1000002;
  denom = pw[ex];
  num = denom - num;
  long long div = no2(K);
  div %= 1000002;
  long long w = 1000002 - div;
  denom *= pw[w];
  num *= pw[w];
  num %= 1000003;
  num += 1000003;
  num %= 1000003;
  denom += 1000003;
  denom %= 1000003;
  cout << num << ' ' << denom << '\n';
  return 0;
}
