#include <bits/stdc++.h>
using namespace std;
const int N = 1e9 + 8, Mod = 1e6 + 3;
long long n, k, A, B, p;
long long Pow(long long x, long long y) {
  if (y == 0) return 1;
  long long c = Pow(x, y / 2);
  c = c * 1ll * c % Mod;
  if (y & 1) c = c * 1ll * x % Mod;
  return c;
}
int main() {
  cin >> n >> k;
  if (n <= 60 && (1ll << n) < k) return cout << "1 1", 0;
  for (long long i = 2; i <= k - 1; i *= 2) {
    p += (k - 1) / i;
  }
  B = Pow(Pow(2, n), k - 1) * 1ll * Pow(Pow(2, p), Mod - 2) % Mod;
  if (k < Mod) A++;
  long long s = Pow(2, n);
  if (k < Mod) {
    for (long long i = 1; i < k; i++) {
      A = A * (s - i) % Mod;
    }
  }
  A = A * Pow(Pow(2, p), Mod - 2) % Mod;
  cout << (B - A + Mod) % Mod << ' ' << B;
}
