#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cout.setf(ios::fixed);
  cout.precision(10);
  int n, initialWeight, i;
  cin >> n >> initialWeight;
  vector<int> takeOffCoefficients(n), landingCoefficients(n);
  for (i = 0; i < n; ++i) cin >> takeOffCoefficients[i];
  for (i = 0; i < n; ++i) cin >> landingCoefficients[i];
  for (i = 0; i < n; ++i) {
    if (landingCoefficients[i] == 1 || takeOffCoefficients[i] == 1) {
      cout << "-1\n";
      return 0;
    }
  }
  double fuelWeightForEarthLanding =
      (double)initialWeight / (double)(landingCoefficients[0] - 1);
  double currentWeight = initialWeight + fuelWeightForEarthLanding;
  for (i = n - 1; i > 0; --i) {
    double fuelWeightForTakeOff =
        (double)currentWeight / (double)(takeOffCoefficients[i] - 1);
    currentWeight += fuelWeightForTakeOff;
    double fuelWeightForLanding =
        (double)currentWeight / (double)(landingCoefficients[i] - 1);
    currentWeight += fuelWeightForLanding;
  }
  double fuelWeightForEarthTakeOff =
      (double)currentWeight / (double)(takeOffCoefficients[0] - 1);
  currentWeight += fuelWeightForEarthTakeOff;
  cout << currentWeight - initialWeight << "\n";
  return 0;
}
