#include <bits/stdc++.h>
using namespace std;
const int mod = 1e6 + 3;
long long quickpow(long long a, long long x) {
  long long ans = 1;
  while (x) {
    if (x & 1) ans = ans * a % mod;
    x >>= 1;
    a = a * a % mod;
  }
  return ans;
}
int main() {
  long long n, k, x = 0, m = 0;
  cin >> n >> k;
  while ((1ll << x) < k) x++;
  if (x > n) {
    cout << "1 1" << endl;
    return 0;
  }
  for (long long i = 2; i < k; i <<= 1) m += (k - 1) / i;
  long long p = quickpow(2, mod - 1 - m % (mod - 1));
  long long ans = (quickpow(quickpow(2, n), k - 1) * p) % mod;
  if (mod <= k - 1)
    cout << ans << " " << ans << endl;
  else {
    long long ans1 = 1, ori = quickpow(2, n);
    for (long long i = 1; i < k; i++) ans1 = (ans1 * (ori - i)) % mod;
    ans1 = ans1 * p % mod;
    cout << ((ans - ans1) % mod + mod) % mod << " " << ans << endl;
  }
  return 0;
}
