#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n], b[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  double right = 1e9;
  double left = 0;
  double fuel = 0;
  while (left + 1e-6 < right) {
    double mid = (left + right) / 2;
    fuel = mid;
    for (int i = 0; i < n; i++) {
      int from = i;
      int to = (i + 1) % n;
      if (fuel <= 0) {
        fuel = -0x3f3f3f3f;
        break;
      }
      fuel -= (fuel + m) / a[i];
      if (fuel <= 0) {
        fuel = -0x3f3f3f3f;
        break;
      }
      fuel -= (fuel + m) / b[i];
    }
    if (fuel >= 0)
      right = mid;
    else
      left = mid;
  }
  if (fuel != -0x3f3f3f3f)
    cout << fixed << left << endl;
  else
    cout << -1 << endl;
}
