#include <bits/stdc++.h>
using namespace std;
double kell;
int n;
double a[1003];
double b[1003];
void land(int i) {
  double X = kell / (b[i] - 1);
  kell = kell + X;
}
void getoff(int i) {
  double X = kell / (a[i] - 1);
  kell = kell + X;
}
bool voltegy;
double alap;
int main() {
  cin >> n >> kell;
  alap = kell;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1) voltegy = true;
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    if (b[i] == 1) voltegy = true;
  }
  if (voltegy) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = n - 1; i >= 0; i--) {
    land((i + 1) % n);
    getoff(i);
  }
  cout << setprecision(20) << fixed << kell - alap << endl;
}
