#include <bits/stdc++.h>
using namespace std;
int main() {
  long double n, m;
  cin >> n >> m;
  if (n == 1 && m == 1)
    cout << 1;
  else
    cout << fixed << setprecision(15)
         << 1 / n + (m - 1) / (n * m - 1) * (n - 1) / n;
}
