#include <bits/stdc++.h>
const int inf = 1039074182;
using namespace std;
int n, m;
int a[1005], b[1005];
long double res;
long double cal(long double x, long double cost) {
  long double t = x / (cost - 1);
  return x + t;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", b + i);
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == 1 || b[i] == 1) {
      cout << -1 << endl;
      exit(0);
    };
  }
  res = m;
  res = cal(res, (long double)b[0]);
  for (int i = 1; i < n; i++) {
    res = cal(res, a[i]);
    res = cal(res, b[i]);
  }
  res = cal(res, a[0]);
  cout.precision(10);
  cout << res - m << endl;
  return 0;
}
