#include <bits/stdc++.h>
using namespace std;
const int M = 1e6 + 3;
inline long long mod(long long x, long long m) { return (x % m + m) % m; }
long long mp(long long b, long long e, long long m = M) {
  b = mod(b, m);
  long long a = 1;
  while (e > 0) {
    if (e & 1) a = a * b % m;
    if (e >>= 1) b = b * b % m;
  }
  return mod(a, m);
}
long long inv(long long b) { return mp(b, M - 2, M); }
int bits(long long x) {
  int c = 0;
  while (x != 0) {
    ++c;
    x >>= 1;
  }
  return c;
}
long long f(long long x) {
  int b = bits(x);
  long long ans = 0;
  for (int i = 1; i <= b; ++i) {
    ans += (x >> i);
  }
  return ans;
}
int main() {
  long long n, k;
  cin >> n >> k;
  if (n < 63 && (1ll << n) < k) return cout << "1 1\n", 0;
  long long two = f(k - 1);
  long long g = mp(2, two);
  long long A = 0;
  if (k < M) {
    A = 1;
    long long two_n = mp(2, n);
    for (int i = 1; i < k; ++i) A = A * (two_n - i) % M;
  }
  long long nk = n % (M - 1) * ((k - 1) % (M - 1)) % (M - 1);
  long long B = mp(2, nk);
  A = mod((B - A) * inv(g), M);
  B = mod(B * inv(g), M);
  cout << A << ' ' << B << endl;
}
