#include <bits/stdc++.h>
using namespace std;
int N, M;
int A[1005], B[1005];
const double eps = 0.000000001;
void Read() {
  cin >> N >> M;
  for (int i = 1; i <= N; i++) {
    cin >> A[i];
  }
  for (int i = 1; i <= N; i++) cin >> B[i];
}
bool check(double val) {
  if (((val + M) / (double)A[1]) > val + eps) return 0;
  val -= ((val + M) / (double)A[1]);
  for (int i = 2; i <= N; i++) {
    if (((val + M) / (double)B[i]) > val + eps) return 0;
    val -= ((val + M) / (double)B[i]);
    if (((val + M) / (double)A[i]) > val + eps) return 0;
    val -= ((val + M) / (double)A[i]);
  }
  if (((val + M) / (double)B[1]) > val + eps) return 0;
  val -= ((val + M) / (double)B[1]);
  return 1;
}
void binS() {
  long long left = 0, right = 1000000000000000000, mid, sol = -1;
  while (left <= right) {
    mid = (left + right) / 2;
    if (check((double)mid / 1000000000.0)) {
      sol = mid;
      right = mid - 1;
    } else
      left = mid + 1;
  }
  if (sol == -1) {
    cout << "-1\n";
    return;
  }
  cout << fixed << setprecision(15) << (double)sol / 1000000000.0;
}
int main() {
  Read();
  binS();
  return 0;
}
