#include <bits/stdc++.h>
using namespace std;
int n;
double a[50005], b[50005], m;
inline bool check(double x) {
  for (int i = 1; i <= n; i++) {
    x = x - (x + m) / a[i];
    x = x - (x + m) / b[i + 1];
    if (x < 0) return 0;
  }
  return 1;
}
int main() {
  scanf("%d%lf", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%lf", &b[i]);
  b[n + 1] = b[1];
  double l = 0, r = 2e9;
  while (l + 1e-8 < r) {
    double mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  if (l < 1500000000)
    printf("%.10lf\n", l);
  else
    puts("-1");
  return 0;
}
