#include <bits/stdc++.h>
using namespace std;
int n;
double st;
double lf[1005], ld[1005];
int main() {
  scanf("%d", &n);
  scanf("%lf", &st);
  double tp = st;
  for (int i = 1; i <= n; i++) scanf("%lf", &lf[i]);
  for (int i = 1; i <= n; i++) scanf("%lf", &ld[i]);
  if (ld[1] <= (double)1)
    printf("-1");
  else {
    double x = st / (ld[1] - 1);
    st += x;
    bool mark = true;
    for (int i = n; i >= 2; i--) {
      if (ld[i] <= (double)1 || lf[i] <= (double)1) {
        mark = false;
        break;
      }
      double x = st / (lf[i] - 1);
      st += x;
      x = st / (ld[i] - 1);
      st += x;
    }
    if (lf[1] <= (double)1)
      mark = false;
    else {
      double x = st / (lf[1] - 1);
      st += x;
    }
    if (mark == false)
      printf("-1");
    else
      printf("%.10lf", st - tp);
  }
  return 0;
}
