#include <bits/stdc++.h>
using namespace std;
const int N = 1007;
double a[N], b[N], w;
int n;
bool check(double f) {
  double x = (w + f) / a[0];
  f -= x;
  for (int i = 1; i < n; ++i) {
    x = (w + f) / b[i];
    f -= x;
    x = (w + f) / a[i];
    f -= x;
    if (f < 0) return 0;
  }
  x = (w + f) / b[0];
  f -= x;
  if (f < 0) return 0;
  return 1;
}
int main() {
  int T;
  cin >> n;
  cin >> w;
  for (int i = 0; i < n; ++i) {
    scanf("%lf", &a[i]);
  }
  for (int i = 0; i < n; ++i) {
    scanf("%lf", &b[i]);
  }
  double l = 0, r = 1e9 + 7;
  if (!check(r)) {
    printf("-1\n");
    return 0;
  }
  int step = 100;
  while (step--) {
    double mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%0.7lf\n", l);
  return 0;
}
