#include <bits/stdc++.h>
using ll = long long;
const int mod = 1e6 + 3;
using namespace std;
ll n, k;
ll dfs(ll k) {
  if (k <= 1) return 0;
  return k / 2 + dfs(k / 2);
}
ll qw(ll a, ll t) {
  a %= mod;
  ll ans = 1;
  while (t) {
    if (t & 1) ans = ans * a % mod;
    a = a * a % mod;
    t >>= 1;
  }
  return ans;
}
ll D(ll x) {
  x = (x - 1) % mod;
  return x;
}
ll inv(ll x) { return qw(x, mod - 2); }
bool judge(ll k, ll n) {
  if (k < n) return 0;
  if (log(k) / log(2) < n - 2) return 0;
  return k > powl(2, n);
}
int main() {
  scanf("%lld%lld", &n, &k);
  ll ge = dfs(k - 1) + n;
  ll out = qw(2, n);
  out = qw(out, k);
  ll niyuan = inv(qw(2, ge));
  out = out * niyuan % mod;
  if (judge(k, n)) {
    puts("1 1");
    return 0;
  }
  if (k >= 1e6 + 3) {
    printf("%lld %lld\n", out, out);
  } else {
    ll st = qw(2, n);
    ll ans = 1;
    for (int i = 0; i < k; i++) {
      ans = ans * st % mod;
      st = D(st);
    }
    if (ans == 0) {
      printf("%lld %lld\n", out, out);
    } else {
      ans = ans * niyuan % mod;
      printf("%lld %lld\n", ((out - ans) % mod + mod) % mod, out);
    }
  }
}
