#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[1001];
int b[1001];
bool possible(double fuel) {
  if (fuel <= 0) return false;
  for (int i = 0; i < n - 1; i++) {
    fuel = fuel - (1.0 * (m + fuel) / (1.0 * a[i]));
    if (fuel <= 0) return false;
    fuel = fuel - (1.0 * (m + fuel) / (1.0 * b[i + 1]));
    if (fuel <= 0) return false;
  }
  fuel = fuel - (1.0 * (m + fuel) / (1.0 * a[n - 1]));
  if (fuel <= 0) return false;
  fuel = fuel - (1.0 * (m + fuel) / (1.0 * b[0]));
  if (fuel >= 0) return true;
  return false;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  double low = 0.000001;
  double high = 1000000007.0;
  double ans;
  bool flag = false;
  for (int iter = 0; iter <= 200; iter++) {
    double mid = (low + high) / 2.0;
    if (possible(mid)) {
      ans = mid;
      flag = true;
      high = mid;
    } else {
      low = mid;
    }
  }
  if (flag) {
    printf("%.18lf\n", ans);
  } else {
    cout << -1 << endl;
  }
  return 0;
}
