#include <bits/stdc++.h>
using namespace std;
int n;
double m, a[1010], b[1010], c[2010], ans;
bool f;
void deal(int lc, double left) {
  if (lc == 2 * n + 1) {
    ans = left;
    return;
  }
  if ((left == 0.0 && lc <= 2 * n && lc != 1) || (left < 0) || (c[lc] == 1.0)) {
    f = 1;
    return;
  }
  deal(lc + 1, (m + c[lc] * left) / (c[lc] - 1.0));
}
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]);
  c[1] = b[1];
  int pa = n, pb = n;
  for (int i = 2; i <= 2 * n; i++)
    if (i % 2 == 0)
      c[i] = a[pa--];
    else
      c[i] = b[pb--];
  deal(1, 0.0);
  if (f)
    printf("-1");
  else
    printf("%.10f", ans);
  return 0;
}
