#include <bits/stdc++.h>
using namespace std;
int possible(vector<int> &arr, vector<int> &brr, int m, double mid, int n) {
  int i;
  for (i = 0; i < n - 1; i++) {
    mid -= (double)(m + mid) / arr[i];
    if (mid < 0) return 0;
    mid -= (double)(m + mid) / brr[i + 1];
    if (mid < 0) return 0;
  }
  mid -= (double)(m + mid) / arr[n - 1];
  if (mid < 0) return 0;
  mid -= (double)(m + mid) / brr[0];
  return mid >= 0;
}
void test() {
  int n;
  cin >> n;
  int i, m;
  cin >> m;
  vector<int> arr(n);
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  vector<int> brr(n);
  for (i = 0; i < n; i++) {
    cin >> brr[i];
  }
  double l = 1, h = 1000000001, mid, ans;
  if (possible(arr, brr, m, h, n) == 0) {
    cout << "-1\n";
    return;
  }
  while (l <= h) {
    mid = l + (h - l) / 2;
    if (possible(arr, brr, m, mid, n) == 1) {
      ans = mid;
      h = mid - 0.0000001;
    } else {
      l = mid + 0.0000001;
    }
  }
  cout << fixed << setprecision(6) << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    test();
  }
}
