#include <bits/stdc++.h>
using namespace std;
int n, m, a[1004], b[1004];
const double eps = 0.000000000001;
bool check(double x, bool DEBUG = 0) {
  double mass = (double)m;
  for (int i = 0; i < n; i++) {
    if (DEBUG) cout << "BEFORE TAKEOFF " << x << endl;
    if (x + eps < 0 || abs(x) < eps) return 0;
    double takeoff = (double)a[i];
    double land = (double)b[(i + 1) % n];
    x = x - (x + mass) / takeoff;
    if (DEBUG) cout << "BEFORE LAND " << x << endl;
    if (x + eps < 0 || abs(x) < eps) return 0;
    x = x - (x + mass) / land;
    if (DEBUG) cout << "AFTER LAND " << x + eps << endl;
  }
  if (x + eps < 0) return 0;
  return 1;
}
int main() {
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) scanf("%d", &b[i]);
  double lo = 1, hi = 1e9;
  for (int i = 0; i < 200; i++) {
    double mi = lo + (hi - lo) / 2;
    if (check(mi))
      hi = mi;
    else
      lo = mi;
  }
  if (check(hi, 0))
    printf("%.10lf", hi);
  else
    printf("-1");
  return 0;
}
