#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n1, n2, i, j, n, ma = 0, temp, c;
  cin >> n1 >> n2;
  if (n1 < n2) {
    cout << "2";
  } else {
    cout << n1;
  }
  return 0;
}
