#include <bits/stdc++.h>
using namespace std;
using PII = pair<long long, long long>;
const int maxn = 5e6 + 5;
const long long mod = 1e6 + 3;
const int inf = 1e9;
long long bit[64];
inline long long powmod(long long a, long long b) {
  long long ans = 1;
  a %= mod;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  bit[0] = 1;
  for (int i = 1; i <= 62; i++) bit[i] = bit[i - 1] << 1;
  long long n, k;
  cin >> n >> k;
  if ((n <= 62 && k > (1LL << n)))
    cout << "1 1" << '\n';
  else {
    n = powmod(2, n);
    long long a = 0, b = powmod(n, k), inv = 1;
    k--;
    for (int i = 1; i <= 61; i++)
      inv = inv * powmod(bit[i], k / bit[i] - k / bit[i + 1]) % mod;
    inv = inv * n % mod;
    inv = powmod(inv, mod - 2);
    if (k < mod) {
      a = inv;
      for (int i = 0; i <= k; i++) a = a * (n - i) % mod;
    }
    b = (b * inv % mod + mod) % mod;
    a = ((b - a) % mod + mod) % mod;
    cout << a << " " << b << '\n';
  }
}
