#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.1415926535897932384626433832795;
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
  out << '(' << p.first << ", " << p.second << ')';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
  int l = v.size();
  for (int i = 0; i < l - 1; i++) out << v[i] << ' ';
  if (l > 0) out << v[l - 1];
  return out;
}
void tr() { cout << endl; }
template <typename S, typename... Strings>
void tr(S x, const Strings&... rest) {
  cout << x << ' ';
  tr(rest...);
}
long long fast(long long a, long long b, long long MOD) {
  long long ret = 1;
  while (b) {
    if ((b & 1)) ret = (ret * a) % MOD;
    a = (a * a) % MOD;
    b >>= 1;
  }
  return ret;
}
const long long MOD = 1e6 + 3;
int main() {
  long long n, k;
  cin >> n >> k;
  if (n <= 59 and (1ll << n) < k) {
    cout << 1 << ' ' << 1 << endl;
    return 0;
  }
  long long a, b;
  b = fast(2, n, MOD);
  b = fast(b, k - 1, MOD);
  a = 1;
  long long x = (k - 1) / MOD;
  long long y = (k - 1) % MOD;
  long long t = fast(2, n, MOD);
  for (int i = 1; i <= MOD; i++) {
    a *= (t - i + MOD) % MOD;
    a %= MOD;
  }
  a = fast(a, x, MOD);
  for (int i = 1; i <= y; i++) {
    a *= (t - i + MOD) % MOD;
    a %= MOD;
  }
  long long tot = 0, tmp = k - 1, pw = 2;
  while (pw <= tmp) {
    tot += tmp / pw;
    pw <<= 1;
  }
  a = a * fast(fast(2, tot, MOD), MOD - 2, MOD) % MOD;
  b = b * fast(fast(2, tot, MOD), MOD - 2, MOD) % MOD;
  a = (b - a + MOD) % MOD;
  cout << a << ' ' << b << endl;
  return 0;
}
