#include <bits/stdc++.h>
using namespace std;
long long P = 1000003;
long long v2(long long a, long long b) {
  long long ans = 0;
  for (long long i = 2; b / i != (a - 1) / i; i *= 2) {
    ans += b / i - (a - 1) / i;
  }
  return ans;
}
long long fastexp(long long a, long long exp) {
  if (exp == 0) return 1;
  if (exp % 2 == 0) {
    long long s = fastexp(a, exp / 2);
    return (s * s) % P;
  } else
    return (fastexp(a, exp - 1) * a) % P;
}
pair<long long, long long> bezout(long long a, long long b) {
  if (a < b) {
    pair<long long, long long> s = bezout(b, a);
    return make_pair(s.second, s.first);
  }
  if (a == 1 && b == 0) return make_pair(1, 0);
  long long r = a % b;
  long long q = a / b;
  pair<long long, long long> s = bezout(b, r);
  long long x1 = s.first;
  long long y1 = s.second;
  return make_pair(y1, x1 - y1 * q);
}
long long inv(long long a) {
  a %= P;
  return bezout(a, P).first;
}
int main() {
  ios_base::sync_with_stdio(0);
  long long n, k;
  cin >> n >> k;
  long long A = 1, B;
  long long asd;
  if (n <= 60) {
    asd = 1;
    for (int i = 0; i < n; i++) asd *= 2;
    if (k > asd) {
      cout << "1 1";
      return 0;
    }
  }
  B = fastexp(2, n);
  B = fastexp(B, k);
  B *= inv(fastexp(2, n + v2(1, k - 1)));
  B %= P;
  if (k > P)
    A = 0;
  else {
    long long S = fastexp(2, n);
    long long div2 = inv(2);
    for (long long i = 1; i <= k - 1; i++) {
      long long j = i;
      long long F = S - i;
      while (j % 2 == 0) {
        j /= 2;
        F *= div2;
        F %= P;
      }
      A *= F;
      A %= P;
    }
  }
  A = B - A;
  A %= P;
  if (A < 0) A += P;
  if (B < 0) B += P;
  cout << A << " " << B;
}
