#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
const int maxx = 1e9 + 1;
int a[maxn], b[maxn];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  for (int j = 0; j < n; ++j) {
    scanf("%d", &b[j]);
  }
  double res = m;
  res = res * b[0] / (b[0] - 1.0);
  res = res * a[n - 1] / (a[n - 1] - 1.0);
  for (int i = n - 1; i >= 1; --i) {
    res = res * b[i] / (b[i] - 1.0);
    res = res * a[i - 1] / (a[i - 1] - 1.0);
  }
  res -= m;
  if (res <= maxx)
    printf("%.10lf\n", res);
  else
    printf("-1\n");
  return 0;
}
