#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int IT_MAX = 1 << 21;
const int MOD = 1000000007;
const int INF = 1034567891;
const long long LL_INF = 1234567890123456789ll;
const double PI = 3.141592653589793238;
const long double ERR = 1E-12;
const long long mod = 1e6 + 3;
int ta, tb, tc, td, te;
long long quick_pow(long long x, long long y) {
  if (y == 0) return 1;
  long long tmp = quick_pow(x, y / 2);
  if (y & 1) return tmp * tmp % mod * x % mod;
  return tmp * tmp % mod;
}
long long gcd(long long x, long long y) {
  return x % y == 0 ? y : gcd(y, x % y);
}
int main() {
  long long n, k;
  cin >> n >> k;
  long long ni = quick_pow(2, mod - 2);
  long long tmp = k - 1;
  long long fm = 1;
  if (n < 63 && pow(2, n) < k) {
    printf("1 1\n");
    return 0;
  }
  long long t1 = quick_pow(quick_pow(2, n), k - 1);
  while (tmp) {
    fm *= quick_pow(ni, tmp / 2);
    tmp /= 2;
    fm %= mod;
  }
  long long t4 = t1 * fm % mod;
  if ((k - 1) >= mod) {
    cout << t4 << " " << t4 << endl;
    return 0;
  }
  long long t2 = 1;
  for (int i = 1; i <= (k - 1); i++) {
    t2 *= quick_pow(2, n) + (mod - i);
    t2 %= mod;
  }
  long long t3 = t1 * fm % mod + mod - t2 * fm % mod;
  t3 %= mod;
  cout << t3 << " " << t4 << endl;
}
