#include <bits/stdc++.h>
using namespace std;
double gcd(double a, double b) { return a < 0.01 ? b : gcd(fmod(b, a), a); }
long long bpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
vector<int> parent, rnk;
void make_set(int v) {
  parent[v] = v;
  rnk[v] = 0;
}
int find_set(int v) {
  if (v == parent[v]) return v;
  return parent[v] = find_set(parent[v]);
}
void union_sets(int a, int b) {
  a = find_set(a);
  b = find_set(b);
  if (a != b) {
    if (rnk[a] < rnk[b]) swap(a, b);
    parent[b] = a;
    if (rnk[a] == rnk[b]) rnk[a]++;
  }
}
struct edge {
  int u, v, w;
  bool operator<(edge const& other) { return w < other.w; }
};
long long int n, k, x, y, h;
long long int kv, p;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  long long int m = 1000003;
  if (n <= 60 && k > (1LL << n)) {
    cout << 1 << " " << 1;
    return 0;
  }
  y = 2;
  x = k - 1;
  while (x / y > 0) {
    h += x / y;
    y *= 2;
  }
  kv = (bpow(bpow(2, n - 1, m), k - 1, m) * bpow(2, k - 1 - h, m)) % m;
  y = bpow(2, n, m);
  if (y <= k - 1) {
    cout << kv << " " << kv;
  } else {
    x = log2(k - 1);
    vector<long long int> v;
    for (long long int i = 0; i <= x; i++) {
      v.push_back(bpow(2, n - i, m));
    }
    p = 1;
    for (long long int i = 0; i <= x; i++) {
      for (long long int j = 1; bpow(2, i, m) * j <= k - 1; j += 2)
        p = (p * (v[i] - j + m)) % m;
    }
    cout << (kv - p + m) % m << " " << kv;
  }
  return 0;
}
