#include <bits/stdc++.h>
using namespace std;
const int MAXN = 128;
struct MAT {
  double mat[MAXN][MAXN];
  MAT operator*(const MAT &a) const {
    MAT b;
    memset(b.mat, 0, sizeof(b.mat));
    for (int i = 0; i < MAXN; i++) {
      for (int j = 0; j < MAXN; j++) {
        for (int k = 0; k < MAXN; k++)
          b.mat[i][j] = (b.mat[i][j] + mat[i][k] * a.mat[k][j]);
      }
    }
    return b;
  }
};
MAT Mqpow(MAT base, int b) {
  MAT r;
  for (int i = 0; i < MAXN; i++)
    for (int j = 0; j < MAXN; j++) r.mat[i][j] = i == j;
  while (b) {
    if (b & 1) r = base * r;
    base = base * base;
    b >>= 1;
  }
  return r;
}
int main() {
  int n, x;
  while (scanf("%d %d", &n, &x) != EOF) {
    MAT start, r;
    memset(start.mat, 0, sizeof(start.mat));
    memset(r.mat, 0, sizeof(r.mat));
    for (int i = 0; i <= x; i++) {
      double d;
      scanf("%lf", &d);
      for (int i0 = 0; i0 < 128; i0++) {
        start.mat[i0 ^ i][i0] += d;
      }
    }
    r.mat[0][0] = 1;
    printf("%.12f\n", 1 - (Mqpow(start, n) * r).mat[0][0]);
  }
  return 0;
}
