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