#include <bits/stdc++.h>
using namespace std;
long long maxi(long long a, long long b) { return a > b ? a : b; }
long long mini(long long a, long long b) { return a < b ? a : b; }
bool comparator(long long a, long long b) { return a > b; }
void debug(char a, long long b) { cout << a << ": " << b << '\n'; }
void debug(char a, long long aa, char b, long long bb) {
  cout << a << ": " << aa << ", " << b << ": " << bb << '\n';
}
void debug(char a, long long aa, char b, long long bb, char c, long long cc) {
  cout << a << ": " << aa << ", " << b << ": " << bb << ", " << c << ": " << cc
       << '\n';
}
void debug(char a, char aa) { cout << a << ": " << aa << '\n'; }
void debug(char a, char aa, char b, char bb) {
  cout << a << ": " << aa << ", " << b << ": " << bb << '\n';
}
void debug(char a, char aa, char b, char bb, char c, char cc) {
  cout << a << ": " << aa << ", " << b << ": " << bb << ", " << c << ": " << cc
       << '\n';
}
void AUTO() {}
long long MOD = 1e9 + 6;
string s;
long long n, k;
int main() {
  AUTO();
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, M;
  cin >> n >> M;
  long long a[n + 1], b[n + 1];
  for (int i = 0; i < (int)n; i++) cin >> a[i + 1];
  for (int i = 0; i < (int)n; i++) cin >> b[i + 1];
  bool ok = true;
  for (int i = 0; i < (int)n; i++)
    if (a[i + 1] - 1 <= 0) ok = false;
  if (!ok)
    cout << -1 << '\n';
  else {
    for (int i = 0; i < (int)n; i++)
      if (b[i + 1] - 1 <= 0) ok = false;
    if (!ok)
      cout << -1 << '\n';
    else {
      double fuel = 0;
      fuel += ((long double)M) / (b[1] - 1);
      for (int i = n; i >= 1; i--) {
        fuel += ((long double)(M + fuel)) / (a[i] - 1);
        if (i != 1) fuel += ((long double)(M + fuel)) / (b[i] - 1);
      }
      cout.precision(10);
      cout << fuel << '\n';
    }
  }
  return 0;
}
