#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, k, a[1000], b[1000], c[2000];
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  c[0] = b[0];
  int j = 1;
  for (int i = n - 1; i >= 1; i--) {
    c[j] = a[i];
    j++;
    c[j] = b[i];
    j++;
  }
  c[j] = a[0];
  double an = 0;
  for (int i = 0; i < 2 * n; i++) {
    if (c[i] == 1) {
      cout << -1;
      return 0;
    }
    an += k / (-1 + c[i]);
    k += k / (-1 + c[i]);
  }
  printf("%.8f\n", an);
}
