#include <bits/stdc++.h>
using namespace std;
int lift[1111], load[1111];
int n;
int w;
const double eps = 0.0000000001;
bool is_ok(double fuel) {
  if (fuel <= eps) return false;
  fuel -= (w + fuel) / lift[0];
  if (fuel <= eps) return false;
  for (int i = 1; i < n; i++) {
    fuel -= (w + fuel) / load[i];
    if (fuel < eps) return false;
    fuel -= (w + fuel) / lift[i];
    if (fuel < eps) return false;
  }
  fuel -= (w + fuel) / load[0];
  if (fuel <= eps) return false;
  return true;
}
int main() {
  cin >> n >> w;
  bool flag = true;
  for (int i = 0; i < n; i++) {
    cin >> lift[i];
    if (lift[i] == 1) {
      flag = false;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> load[i];
    if (load[i] == 1) {
      flag = false;
    }
  }
  if (!flag) {
    cout << -1;
  } else {
    double front = eps, end = 1000000000.0;
    int times = 1000;
    double mid;
    while (--times) {
      mid = (front + end) / 2.;
      if (is_ok(mid))
        end = mid;
      else
        front = mid;
    }
    printf("%.10f", mid);
  }
}
