#include <bits/stdc++.h>
using namespace std;
bool Finish_read;
template <class T>
inline void read(T &x) {
  Finish_read = 0;
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    if (ch == EOF) return;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x *= f;
  Finish_read = 1;
}
int c[51];
int main() {
  int n;
  double m;
  scanf("%d%lf", &n, &m);
  double a[1001], b[1001];
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%lf", &b[i]);
  double t = m;
  t += m / (b[1] - 1);
  if (fabs(b[1] - 1) < 1e-6) {
    cout << -1;
    return 0;
  }
  for (int i = n; i >= 1; i--) {
    t += t / (a[i] - 1);
    if (fabs(a[i] - 1) < 1e-6) {
      cout << -1;
      return 0;
    }
    if (i != 1) t += t / (b[i] - 1);
    if (fabs(b[i] - 1) < 1e-6) {
      cout << -1;
      return 0;
    }
  }
  printf("%.8f\n", t - m);
}
