#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  if (N == 1 && M == 1)
    cout << 1 << '\n';
  else
    printf("%.10lf\n", 1.0 * (2 * N * M - N - M) / N / (N * M - 1));
  return 0;
}
