#include <bits/stdc++.h>
int main() {
  double n, m;
  scanf("%lf%lf", &n, &m);
  int a[1000], b[1000];
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < n; i++) scanf("%d", b + i);
  double x;
  if (b[0] != 1 && a[0] != 1) {
    x = m + m / (b[0] - 1);
    for (int i = n - 1; i >= 1; i--) {
      if (a[i] == 1 || b[i] == 1) {
        printf("-1");
        return 0;
      }
      x += x / (a[i] - 1);
      x += x / (b[i] - 1);
    }
    x += x / (a[0] - 1);
    printf("%.10f", x - m);
  } else
    printf("-1");
  return 0;
}
