#include <bits/stdc++.h>
using namespace std;
int n;
double a[1005], b[1005], m, l, r, d, wei, tmp;
bool o;
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]);
  }
  l = 0;
  r = 2e9;
  for (int i = 1; i <= 200; i++) {
    d = (l + r) / 2;
    o = 1;
    wei = d;
    for (int j = 1; j <= n - 1; j++) {
      tmp = (wei + m) / a[j];
      if (tmp > wei) {
        o = 0;
        break;
      }
      wei -= tmp;
      tmp = (wei + m) / b[j + 1];
      if (tmp > wei) {
        o = 0;
        break;
      }
      wei -= tmp;
    }
    if (o) {
      tmp = (wei + m) / a[n];
      if (tmp > wei) {
        o = 0;
      }
      wei -= tmp;
      if (o) {
        tmp = (wei + m) / b[1];
        if (tmp > wei) {
          o = 0;
        }
      }
    }
    if (o)
      r = d;
    else
      l = d;
  }
  if ((l + r) / 2 > 1e9 + 1)
    printf("-1\n");
  else
    printf("%.7lf\n", (l + r) / 2);
  return 0;
}
