#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = 10 * x + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
int power(int x, int y) {
  int t = 1;
  for (; y; y >>= 1, x = x * x % 1000000007)
    if (y & 1) t = t * x % 1000000007;
  return t;
}
int n, m;
long double a[1005], b[1005];
long double c[2010];
int main() {
  n = read();
  m = read();
  int flag = 0;
  for (int i = 1; i <= (n); i++) {
    a[i] = read();
    if (a[i] == 1) {
      cout << "-1" << endl;
      return 0;
    }
  }
  for (int i = 1; i <= (n); i++) {
    b[i] = read();
    if (b[i] == 1) {
      cout << "-1" << endl;
      return 0;
    }
  }
  long double now = (long double)m;
  int tot = 0;
  c[++tot] = b[1];
  long double need = now / (c[tot] - 1);
  now += need;
  for (int i = n; i > 1; i--) {
    c[++tot] = a[i];
    need = now / (c[tot] - 1);
    now += need;
    c[++tot] = b[i];
    need = now / (c[tot] - 1);
    now += need;
  }
  c[++tot] = a[1];
  need = now / (c[tot] - 1);
  now += need;
  printf("%.10Lf", (long double)now - (long double)m);
  return 0;
}
