#include <bits/stdc++.h>
using namespace std;
vector<long long int> a(1001), b(1001);
long long int n, m, i, j;
double fin(double x) {
  double wt = double(x + m);
  for (j = 0; j < n; j++) {
    wt -= wt / a[j];
    wt -= wt / b[(j + 1) % n];
  }
  return wt - m;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) cin >> b[i];
  double low = 0.00, high = 2000000000, mid;
  for (i = 0; i < 1000; i++) {
    mid = low + (high - low) / 2;
    double val = fin(mid);
    if (val == 0.00) {
      low = mid;
      break;
    }
    if (val < 0.0)
      low = mid;
    else
      high = mid;
  }
  if (abs(fin(low)) < 1e-8)
    cout << fixed << setprecision(10) << low << endl;
  else
    cout << -1 << endl;
}
