#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const int maxn = 1005;
int a[maxn];
int b[maxn];
int n;
double m0, m, x;
int main() {
  scanf("%d%lf", &n, &m);
  m0 = 0;
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] == 1) {
      flag = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
    if (b[i] == 1) {
      flag = 1;
    }
  }
  x = m / (b[1] - 1);
  m0 += x;
  m += x;
  for (int i = n; i >= 2; i--) {
    x = m / (a[i] - 1);
    m0 += x;
    m += x;
    x = m / (b[i] - 1);
    m0 += x;
    m += x;
  }
  x = m / (a[1] - 1);
  m0 += x;
  m += x;
  if (flag)
    printf("-1\n");
  else
    printf("%.10llf\n", m0);
  return 0;
}
