#include <bits/stdc++.h>
using namespace std;
const int N = 128;
struct mat {
  double data[N][N];
  mat operator*(const mat& rhs) const {
    mat res = {{}};
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        for (int k = 0; k < N; k++)
          res.data[i][j] += data[i][k] * rhs.data[k][j];
      }
    }
    return res;
  }
};
int n, x;
double p[N];
void print(mat& ma) {
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) printf("%.3lf ", ma.data[i][j]);
    printf("\n");
  }
}
mat qp(mat m, int p) {
  mat ret = {{}};
  for (int i = 0; i < N; i++) ret.data[i][i] = 1.0;
  while (p > 0) {
    if (p & 1) ret = ret * m;
    m = m * m;
    p /= 2;
  }
  return ret;
}
int main() {
  scanf("%d%d", &n, &x);
  for (int i = 0; i < N; i++) p[i] = 0.0;
  for (int i = 0; i <= x; i++) scanf("%lf", p + i);
  mat a;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      a.data[i][j] = p[i ^ j];
    }
  }
  mat res = qp(a, n);
  double ans = 1.0;
  ans -= res.data[0][0];
  printf("%.12lf\n", ans);
}
