#include <bits/stdc++.h>
using namespace std;
const int N = 1001;
const long long MOD = 1e9 + 7;
const double eps = 1e-9;
int n, m, a[N], b[N];
bool check(double f) {
  double ms = m + f;
  double r = ms / a[0];
  if (r > f + eps) return 0;
  f -= r;
  ms = m + f;
  for (int i = 1; i < n; i++) {
    r = ms / b[i];
    if (r > f + eps) return 0;
    f -= r;
    ms = m + f;
    r = ms / a[i];
    if (r > f + eps) return 0;
    f -= r;
    ms = m + f;
  }
  r = ms / b[0];
  if (r > f + eps) return 0;
  return 1;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < n; i++) scanf("%d", b + i);
  double l = 0.0, r = 1e9, md, ans = -1;
  int it = 1000;
  while (l < r && it) {
    md = (l + r) / 2;
    it--;
    if (check(md)) {
      ans = md;
      r = md;
    } else
      l = md;
  }
  if (ans < eps)
    puts("-1");
  else
    printf("%.7lf\n", ans);
  return 0;
}
