#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
const int MO = 1000000 + 3;
long long n, k;
long long mul(long long a, long long b) { return ((long long)a * b) % MO; }
long long bpow(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2 == 0) {
    long long p = bpow(a, b / 2);
    return mul(p, p);
  }
  long long c = mul(a, bpow(a, b - 1));
  return c;
}
const int BM = MO - 1;
long long F(long long n, long long k) {
  long long res = n % BM;
  for (long long i = 2; i <= k - 1; i <<= 1ll) {
    long long val = (k - 1) / i;
    res = (res + val) % BM;
  }
  return res;
}
void solve() {
  cin >> n >> k;
  if (n <= 60 && k > (1ll << n)) {
    cout << 1 << endl << 1 << endl;
    return;
  }
  long long A = 0, B = 1;
  B = bpow(2, ((long long)(n % BM) * (k % BM)) % BM);
  long long T = bpow(2, n % BM);
  long long i2 = bpow(2, MO - 2);
  long long f = F(n, k);
  long long C = bpow(i2, f);
  if (k <= MO) {
    A = T;
    for (long long i = 1; i < k; ++i) A = mul(A, (T + MO - i) % MO);
    A = mul(A, C);
  }
  B = mul(B, C);
  cout << (B + MO - A) % MO << endl << B << endl;
}
void testgen() {
  FILE* f = fopen("input.txt", "w");
  fclose(f);
}
int main() {
  std::cout << std::fixed;
  std::cout.precision(8);
  std::cerr << std::fixed;
  std::cerr.precision(3);
  solve();
  return 0;
}
