#include <bits/stdc++.h>
using namespace std;
int a[1111];
int b[1111];
int n, m;
double getPrevK(int m, double nextK, int a) {
  return (a * nextK + m) / (a - 1);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i] >> b[i];
    if (a[i] == 1 || b[i] == 1) return cout << -1, 0;
  }
  double k = 0;
  k = getPrevK(m, k, b[1]);
  for (int i = n; i >= 1; --i) {
    k = getPrevK(m, k, a[i]);
    if (i > 1) k = getPrevK(m, k, b[i]);
  }
  printf("%.10f", k);
}
