#include <bits/stdc++.h>
using namespace std;
const long long oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
const long long MOD = 1e6 + 3;
long long modExp(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res = res * a % MOD;
    a = a * a % MOD;
    n /= 2;
  }
  return res;
}
long long o2(long long n) {
  if (!n) return 0;
  return n / 2 + o2(n / 2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k;
  cin >> n >> k;
  if (n <= 60 && ((1LL << n) < k)) {
    cout << "1 1" << endl;
    return 0;
  }
  long long half = (MOD + 1) / 2;
  long long A = 1;
  if (k >= MOD + 10) {
    A = 0;
  } else {
    long long x = modExp(2, n);
    for (long long i = (1); i < (k); i++) A = A * (--x) % MOD;
  }
  A = A * modExp(half, o2(k - 1)) % MOD;
  long long B = modExp(modExp(2, n), k - 1);
  B = B * modExp(half, o2(k - 1)) % MOD;
  A = (B - A + MOD) % MOD;
  cout << A << " " << B << endl;
}
