#include <bits/stdc++.h>
using namespace std;
string ss[10];
bool taken[10][10];
vector<int> vt;
double res;
void binarySearch(double lo, double hi, double m) {
  double mid, tWeight;
  bool ck;
  while (1) {
    if (hi - lo < 0.00000001) break;
    ck = true;
    mid = lo + (hi - lo) / 2.0;
    tWeight = mid + m;
    for (auto it = vt.begin(); it != vt.end(); it++) {
      if (tWeight < m) {
        ck = false;
        break;
      }
      tWeight -= (tWeight / (*it * 1.0));
    }
    if (ck) {
      if (tWeight < m)
        lo = mid;
      else if (tWeight - m <= 0.0000001) {
        res = mid;
        hi = mid;
      } else
        hi = mid;
    } else
      lo = mid;
  }
}
int main() {
  int n;
  double m;
  cin >> n;
  cin >> m;
  int arr[n], brr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] == 1) {
      cout << "-1\n";
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    cin >> brr[i];
    if (brr[i] == 1.0) {
      cout << "-1\n";
      return 0;
    }
  }
  vt.push_back(arr[0]);
  for (int i = 1; i < n; i++) {
    vt.push_back(brr[i]);
    vt.push_back(arr[i]);
  }
  vt.push_back(brr[0]);
  res = -1;
  binarySearch(1.0, 1000000005 * 1.0, m);
  if (res != -1) {
    cout << fixed;
    cout << setprecision(10) << res << '\n';
  } else
    cout << "-1\n";
  return 0;
}
