#include <bits/stdc++.h>
using namespace std;
long long n, k;
long long hat(long long a, long long b) {
  long long re = 1;
  while (b) {
    if (b & 1) re = (re * a) % 1000003;
    b >>= 1;
    a = (a * a) % 1000003;
  }
  return re;
}
long long legendre(long long x) {
  int cnt = 0;
  long long tem = x;
  while (tem) {
    cnt++;
    tem -= (tem & (-tem));
  }
  return x - cnt;
}
void setup() {
  cin >> n >> k;
  long long check = 1;
  bool ok = false;
  for (int i = 1; i <= n; i++) {
    check <<= 1;
    if (check >= k) {
      ok = true;
      break;
    }
  }
  if (!ok) {
    cout << "1 1";
    return;
  }
  long long gcd = legendre(k - 1);
  if (gcd > 1000003 - 1) gcd %= 1000003 - 1;
  long long div = hat(2, 1000003 - 1 - gcd);
  long long down = hat(hat(2, k - 1), n);
  long long up = 1;
  if (k - 1 >= 1000003)
    up = 0;
  else {
    long long twoHat = hat(2, n);
    for (int i = 1; i <= k - 1; i++) up = (up * (twoHat - i)) % 1000003;
  }
  up = (up * div) % 1000003;
  down = (down * div) % 1000003;
  up = ((down - up) % 1000003 + 1000003) % 1000003;
  cout << up << ' ' << down;
}
void xuly() {}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  setup();
  xuly();
  return 0;
}
