#include <bits/stdc++.h>
using namespace std;
int n;
double m;
const int N = 1005;
double a[N], b[N];
double digui(int pos, double m) {
  if (pos <= 1) return m;
  if (a[pos] <= 1 || b[pos] <= 1) {
    puts("-1");
    return -1;
  }
  m += m / (a[pos] - 1);
  m += m / (b[pos] - 1);
  return digui(pos - 1, m);
}
int main() {
  scanf("%d", &n);
  scanf("%lf", &m);
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%lf", &b[i]);
  if (b[1] <= 1) {
    puts("-1");
    return 0;
  }
  double no = digui(n, m / (b[1] - 1) + m);
  if (no == -1) return 0;
  if (a[1] <= 1) {
    puts("-1");
    return 0;
  }
  no += no / (a[1] - 1);
  printf("%.8f\n", no - m);
  return 0;
}
