#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int n;
double load;
int arr[N], brr[N];
int main() {
  cin >> n >> load;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  for (int i = 1; i <= n; i++) cin >> brr[i];
  double mass = load;
  mass = mass / (1.0 - (double)(1.0 / brr[1]));
  for (int i = n; i > 1; i--) {
    mass /= (1.0 - (double)(1.0 / arr[i]));
    mass /= (1.0 - (double)(1.0 / brr[i]));
  }
  mass /= (1.0 - (double)(1.0 / arr[1]));
  mass -= load;
  if (mass > 1e9 + 1e-9)
    cout << -1;
  else
    cout << fixed << setprecision(10) << mass;
  return 0;
}
