#include <bits/stdc++.h>
using namespace std;
long long ModExp(long long a, long long n, long long m) {
  long long x = a, y = 1;
  while (n > 0) {
    if (n % 2) y = (y * x) % m;
    x = (x * x) % m;
    n /= 2;
  }
  return y % m;
}
long long Inverse(long long a, long long m) { return ModExp(a, m - 2, m); }
int main() {
  long long n, k, i, j, m, x, y, z;
  cin >> n >> k;
  for (x = k - 1, m = -1; x > 0; m++, x /= 2)
    ;
  if (m >= n) {
    printf("1 1\n");
    return 0;
  }
  for (z = k - 1, m = 0; z > 1; z /= 2, m += z)
    ;
  z = ModExp(2, n + m, 1000003);
  y = ModExp(2, n, 1000003), k, 1000003;
  if (k - 1 >= 1000003)
    x = 0;
  else {
    i = (y + 1000003 - k + 1) % 1000003;
    x = 1;
    m = k;
    while (m--) {
      x = (x * i) % 1000003;
      i++;
    }
  }
  y = ModExp(y, k, 1000003);
  z = Inverse(z, 1000003);
  x = (x * z) % 1000003;
  y = (y * z) % 1000003;
  x = (y + 1000003 - x) % 1000003;
  cout << x << ' ' << y << '\n';
  return 0;
}
