#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  long long int mi, mx;
  mi = 1;
  mx = m * 2;
  if (m == 0) {
    cout << 0 << " " << 0 << endl;
    exit(0);
  }
  if (m == n) {
    cout << 0 << " ";
  } else {
    cout << 1 << " ";
  }
  if (m + mx > n) {
    cout << n - m;
  } else {
    cout << mx;
  }
}
