#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > v(n);
  for (int i = 0; i < n; ++i) cin >> v[i].first >> v[i].second;
  double l = 0, r = 2e9;
  for (int it = 0; it < 80; ++it) {
    double mid = (l + r) / 2;
    double cur = mid;
    for (int i = 0; i < n; ++i) {
      double remove = (m + cur) / v[i].first;
      cur -= remove;
      remove = (m + cur) / v[(i + 1) % n].second;
      cur -= remove;
    }
    if (cur < 0)
      l = mid;
    else
      r = mid;
  }
  cout.precision(10);
  if (abs(l - 2e9) <= 1e-9)
    cout << -1 << endl;
  else
    cout << l << endl;
  return 0;
}
