#include <bits/stdc++.h>
using namespace std;
int main() {
  cout.setf(ios::fixed);
  cout.precision(10);
  double n;
  cin >> n;
  double m;
  cin >> m;
  vector<double> coefa(n);
  for (int i = 0; i < n; i++) cin >> coefa[i];
  vector<double> coefb(n);
  for (int i = 0; i < n; i++) cin >> coefb[i];
  bool b = true;
  double fuel;
  if (coefb[0] - 1 <= 0)
    b = false;
  else {
    fuel = m / (coefb[0] - 1);
    for (int i = n - 1; i > 0 and b == true; i--) {
      if (coefb[i] - 1 <= 0) b = false;
      if (coefa[i] - 1 <= 0) b = false;
      fuel += (m + fuel) / (coefa[i] - 1);
      fuel += (m + fuel) / (coefb[i] - 1);
    }
    if (coefa[0] - 1 <= 0) b = false;
    fuel += (m + fuel) / (coefa[0] - 1);
  }
  if (b == true)
    cout << fuel << endl;
  else
    cout << -1 << endl;
}
