#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, m, a[1001], b[1001], litri = 0, ok = 1;
  cin >> n >> m;
  double copie = m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  litri = m / (b[1] - 1);
  for (int i = n; i >= 1; i--) {
    m = m + litri;
    litri = m / (a[i] - 1);
    m = m + litri;
    litri = m / (b[i] - 1);
    if (a[i] == 1 || b[i] == 1) ok = 0;
  }
  double diferenta;
  diferenta = m - copie;
  if (ok == 0)
    cout << -1;
  else
    cout << fixed << setprecision(10) << diferenta;
  return 0;
}
