#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
int a[1111], n, m;
int b[1111];
double rest(double x) {
  for (int i = 0; i < n; ++i) {
    x -= (x + m) / a[i];
    if (x < 0) return -1;
    if (i == n - 1) {
      x -= (x + m) / b[0];
    } else {
      x -= (x + m) / b[i + 1];
    }
    if (x < 0) return -1;
  }
  return x;
}
int main() {
  bool f = 0;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    if (a[i] <= 1) f = 1;
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", &b[i]);
    if (b[i] <= 1) f = 1;
  }
  if (f) {
    puts("-1");
    return 0;
  }
  double r = 1e9;
  double l = 0;
  while (true) {
    double mid = (r + l) / 2;
    if (r - l < 1e-8) {
      printf("%.7f", mid);
      break;
    }
    double s = rest(mid);
    if (s > 1e-8) {
      r = mid;
    } else if (abs(s) < 1e-8) {
      printf("%.7f", mid);
      break;
    } else {
      l = mid;
    }
  }
}
