#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m, i;
  double j, k, h = 0;
  cin >> n;
  cin >> m;
  double a[n], b[n];
  for (i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] == 1) h = 1;
  }
  for (i = 0; i < n; ++i) {
    cin >> b[i];
    if (b[i] == 1) h = 1;
  }
  if (h == 1)
    cout << "-1\n";
  else {
    k = m;
    k = (k * b[0]) / (b[0] - 1);
    for (i = n - 1; i > 0; --i) {
      k = (k * a[i]) / (a[i] - 1);
      k = (k * b[i]) / (b[i] - 1);
    }
    k *= (a[0]) / (a[0] - 1);
    cout << fixed << setprecision(10) << k - m << endl;
  }
  return 0;
}
