#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e2 + 5;
const int N = 127;
int n, x;
double p[MAX];
double mat[MAX][MAX], id[MAX][MAX];
double base[MAX][MAX], tmp[MAX][MAX];
inline void mult(double A[MAX][MAX], double B[MAX][MAX], double C[MAX][MAX]) {
  for (int i = int(0); i < int(N + 1); i++) {
    for (int j = int(0); j < int(N + 1); j++) {
      double cur = 0.0;
      for (int k = int(0); k < int(N + 1); k++) {
        cur = cur + (A[i][k] * B[k][j]);
      }
      C[i][j] = cur;
    }
  }
}
void mat_exp(long long exp) {
  memcpy(base, mat, sizeof base);
  memcpy(mat, id, sizeof mat);
  while (exp) {
    if (exp & 1) {
      memcpy(tmp, mat, sizeof tmp);
      mult(tmp, base, mat);
      exp--;
    } else {
      memcpy(tmp, base, sizeof tmp);
      mult(tmp, tmp, base);
      exp >>= 1;
    }
  }
}
int main() {
  scanf("%d %d", &n, &x);
  for (int i = int(0); i < int(x + 1); i++) {
    scanf("%lf", p + i);
  }
  for (int i = int(0); i < int(N + 1); i++) {
    for (int j = int(0); j < int(N + 1); j++) {
      mat[i][j] = p[i ^ j];
    }
    id[i][i] = 1.0;
  }
  mat_exp(n);
  printf("%.15lf\n", 1.0 - mat[0][0]);
  return 0;
}
