#include <bits/stdc++.h>
using namespace std;
long long a[1005], b[1005], n;
double p, m;
int main() {
  cin >> n >> m;
  p = m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  double f = p / (b[1] - 1);
  if (a[1] == 1 || b[1] == 1) {
    cout << -1 << endl;
    return 0;
  }
  p += f;
  for (int i = n; i >= 2; i--) {
    if (a[i] == 1 || b[i] == 1) {
      cout << -1 << endl;
      return 0;
    }
    f = p / (a[i] - 1);
    p += f;
    f = p / (b[i] - 1);
    p += f;
  }
  f = p / (a[1] - 1);
  p += f;
  printf("%.10f", p - m);
  return 0;
}
