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