#include <bits/stdc++.h>
using namespace std;
const long long N = 1e3 + 5;
long long n, m, k;
long long a[N], b[N];
bool check(long double x) {
  long double weight = m + x;
  for (long long i = 1; i <= n; i++) {
    weight -= (weight / a[i]);
    weight -= (weight / b[i]);
    if (weight < m) return false;
  }
  return true;
}
signed main() {
  std ::ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m;
  cout << fixed;
  cout << setprecision(10);
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i <= n; i++) cin >> b[i];
  long double l = (long double)1, r = (long double)1e9;
  long double ans = r;
  for (long long i = 1; i <= 100; i++) {
    long double mid = (long double)(l + r) / 2;
    bool res = check(mid);
    if (res) {
      ans = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  if (ans == 1e9) {
    cout << -1;
    return 0;
  }
  cout << ans;
}
