#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[1005], b[1005];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    if (a[i] == 1) {
      puts("-1");
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", b + i);
    if (b[i] == 1) {
      puts("-1");
      return 0;
    }
  }
  double ans = m;
  ans = ans / (b[1] - 1) + ans;
  ans = ans / (a[n] - 1) + ans;
  for (int i = n - 1; i >= 1; i--) {
    ans = ans / (b[i + 1] - 1) + ans;
    ans = ans / (a[i] - 1) + ans;
  }
  printf("%.8lf", ans - m);
}
