#include <bits/stdc++.h>
using namespace std;
using namespace std;
inline long long powmod(long long a, long long first, long long mod) {
  a %= mod;
  long long t = 1LL;
  while (first) {
    if (first & 1) t = t * a % mod;
    a = a * a % mod;
    first >>= 1;
  }
  return t;
}
long long mod = 1e6 + 3;
int main() {
  long long m, n, i, j, k;
  cin >> n >> k;
  if (n < 62 && k > (1LL << n)) return puts("1 1");
  long long t = k - 1;
  long long gcd = 0LL;
  long long d = powmod(2, n, mod);
  long long now = 2LL;
  while (now <= t) {
    gcd += (t / now);
    now <<= 1;
  }
  long long ny = powmod(2LL, mod - 2LL, mod);
  long long fz = 1, fm = 1;
  for (i = 2; i <= k; i++) {
    fz = fz * (d - i + 1) % mod;
    if (fz == 0) break;
  }
  long long NY = powmod(ny, gcd, mod);
  fz = fz * NY % mod;
  fm = powmod(2LL, n, mod);
  fm = powmod(fm, k - 1, mod);
  fm = fm * NY % mod;
  fz = (fm - fz + mod) % mod;
  cout << fz << ' ' << fm << endl;
}
