#include <bits/stdc++.h>
using namespace std;
int a[1050], b[1050];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  double have = 0;
  if (b[1] == 1 || a[1] == 1) {
    printf("-1");
    return 0;
  }
  have = (m + have * b[1]) / (b[1] - 1);
  for (int i = n; i > 1; i--) {
    if (b[i] == 1 || a[i] == 1) {
      printf("-1");
      return 0;
    }
    have = (m + have * a[i]) / (a[i] - 1);
    have = (m + have * b[i]) / (b[i] - 1);
  }
  have = (m + have * a[1]) / (a[1] - 1);
  printf("%.10lf", have);
  return 0;
}
