#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[1001], b[1001];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  b[n] = b[0];
  double v = m;
  for (int i = 0; i < n; i++) {
    v /= (1.0 - (double)1 / a[i]);
    v /= (1.0 - (double)1 / b[i + 1]);
    if (a[i] == 1 || b[i + 1] == 1) {
      cout << -1;
      return 0;
    }
  }
  printf("%.10lf", v - m);
  return 0;
}
