#include <bits/stdc++.h>
using namespace std;
int n;
double base;
double a[1005];
double b[1005];
void init() {
  freopen(
      "fly"
      ".inp",
      "r", stdin);
  freopen(
      "fly"
      ".out",
      "w", stdout);
  ios_base::sync_with_stdio(true);
  cin.tie();
  cout.tie();
}
void nhap() {
  scanf("%d", &n);
  scanf("%lf", &base);
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  scanf("%lf", &b[n + 1]);
  for (int i = 2; i <= n; i++) scanf("%lf", &b[i]);
}
void xuli() {
  double res = base;
  int i = n + 1;
  while (true) {
    if ((b[i] - 1) == 0) {
      printf("-1");
      return;
    }
    res = res * b[i] / (b[i] - 1);
    i--;
    if ((a[i] - 1) == 0) {
      printf("-1");
      return;
    }
    res = res * a[i] / (a[i] - 1);
    if (i == 1) break;
  }
  printf("%f ", res - base);
}
int main() {
  nhap();
  xuli();
}
