#include <bits/stdc++.h>
using namespace std;
long long n, k, resa, resb, mod = 1e6 + 3;
long long po(long long a, long long b) {
  if (b == 0) return 1;
  if (b & 1) return a * po(a, b - 1) % mod;
  return po(a * a % mod, b / 2) % mod;
}
long long getdeg(long long k) {
  long long tmp = 2, deg = 0;
  while (tmp <= k) {
    deg += k / tmp;
    tmp *= 2;
    deg %= (mod - 1);
  }
  return deg;
}
void check(long long n, long long k) {
  long long tmp = 1;
  for (long long i = 1, _b = n; i <= _b; i++) {
    if (tmp * 2 >= k) return;
    tmp *= 2;
  }
  if (tmp >= k) return;
  if (tmp < k) {
    cout << 1 << " " << 1;
    exit(0);
  }
}
void Solve() {
  cin >> n >> k;
  check(n, k);
  long long deg = getdeg(k - 1);
  long long mu =
      (n % (mod - 1) * ((k - 1) % (mod - 1)) % (mod - 1) + mod - 1 - deg) %
      (mod - 1);
  resb = po(2, mu);
  if (k - 1 >= mod) {
    cout << resb << " " << resb;
    return;
  }
  resa = 1;
  for (long long i = 1, _b = min(k - 1, mod); i <= _b; i++) {
    long long first = i, second = n;
    while (first % 2 == 0) first /= 2, second--;
    long long z = po(2, second % (mod - 1));
    resa = resa * (z + mod - first) % mod;
  }
  cout << (resb - resa + mod) % mod << " " << resb;
}
int main() {
  int Test_numbers = 1;
  while (Test_numbers--) Solve();
  return 0;
}
