#include <bits/stdc++.h>
using namespace std;
template <int MOD>
class ModInt {
 public:
  ModInt() : value(0) {}
  ModInt(long long val) : value((int)(val < 0 ? MOD + val % MOD : val % MOD)) {}
  ModInt& operator+=(ModInt that) {
    value = value + that.value;
    if (value >= MOD) value -= MOD;
    return *this;
  }
  ModInt& operator-=(ModInt that) {
    value -= that.value;
    if (value < 0) value += MOD;
    return *this;
  }
  ModInt& operator*=(ModInt that) {
    value = (int)((long long)value * that.value % MOD);
    return *this;
  }
  ModInt& operator/=(ModInt that) { return *this *= that.inverse(); }
  ModInt operator+(ModInt that) const { return ModInt(*this) += that; }
  ModInt operator-(ModInt that) const { return ModInt(*this) -= that; }
  ModInt operator*(ModInt that) const { return ModInt(*this) *= that; }
  ModInt operator/(ModInt that) const { return ModInt(*this) /= that; }
  ModInt pow(long long k) const {
    if (value == 0) return 0;
    ModInt n = *this, res = 1;
    while (k) {
      if (k & 1) res *= n;
      n *= n;
      k >>= 1;
    }
    return res;
  }
  ModInt inverse() const {
    long long a = value, b = MOD, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    return ModInt(u);
  }
  int toi() const { return value; }

 private:
  int value;
};
const int MOD = 1000003;
ostream& operator<<(ostream& os, const ModInt<MOD>& x) {
  os << x.toi();
  return os;
}
long long LegendreFormula(long long n, long long p) {
  long long res = 0, d = p, a;
  while ((a = n / d) != 0) {
    res += a;
    d *= p;
  }
  return res;
}
int main() {
  long long N, K;
  cin >> N >> K;
  if (N < 61 && K > (1ll << N)) {
    puts("1 1");
    return 0;
  }
  long long v = LegendreFormula(K - 1, 2);
  ModInt<MOD> n, d;
  d = ModInt<MOD>(2).pow(K - 1).pow(N);
  if (K - 1 < MOD) {
    n = 1;
    ModInt<MOD> a = ModInt<MOD>(2).pow(N);
    for (int(i) = (1); (i) < (int)(K); ++(i)) {
      n *= a - i;
    }
  }
  ModInt<MOD> b = ModInt<MOD>(2).pow(v);
  n /= b;
  d /= b;
  n = d - n;
  cout << n << ' ' << d << endl;
}
