#include<bits/stdc++.h> usingnamespace std; typedefdouble dnt; template <classT> inlinevoidread(T &x){ x = 0; int c = getchar(), f = 1; for (; !isdigit(c); c = getchar()) if (c == 45) f = -1; for (; isdigit(c); c = getchar()) (x *= 10) += f*(c-'0'); } int n, a[105]; dnt f[105][130], g[105][130], h[105]; intmain(){ read(n); g[1][0] = h[0] = 1.0; for (int i = 1; i <= n; i++) read(a[i]); for (int i = 1; i <= 100; i++) for (int j = 0, k = i-1; j < i; j++, k--) h[i] += h[j]*h[k]; for (int i = 2; i <= 100; i++) { for (int x = 0; x <= 127; x++) g[i][x+1] += 2.0*g[i-1][x]*h[i-1]/h[i]; for (int j = 1, k = i-2; j < i-1; j++, k--) for (int x = 0; x <= 127; x++) for (int y = 0; y <= 127; y++) g[i][(x+1)^(y+1)] += g[j][x]*g[k][y]*h[j]*h[k]/h[i]; } for (int x = 0; x <= 127; x++) f[1][x] = g[a[1]][x]; for (int i = 2; i <= n; i++) for (int x = 0; x <= 127; x++) for (int y = 0; y <= 127; y++) f[i][x^y] += f[i-1][x]*g[a[i]][y]; returnprintf("%.6lf\n", 1.0-f[n][0]), 0; }