#include <bits/stdc++.h>
using namespace std;
int size;
struct Matrix {
  double X[128][128];
  Matrix() {}
  void init() {
    memset(X, 0, sizeof(X));
    for (int i = 0; i < size; ++i) X[i][i] = 1;
  }
} aux;
void mult(Matrix &m, Matrix &m1, Matrix &m2) {
  for (int i = 0; i < size; ++i)
    for (int j = 0; j < size; ++j) m.X[i][j] = 0;
  for (int i = 0; i < size; ++i)
    for (int j = 0; j < size; ++j)
      for (int k = 0; k < size; ++k)
        m.X[i][k] = (m.X[i][k] + m1.X[i][j] * m2.X[j][k]);
}
Matrix pow(Matrix &M0, int n) {
  Matrix ret;
  ret.init();
  if (n == 0) return ret;
  if (n == 1) return M0;
  Matrix P = M0;
  while (n != 0) {
    if (n & 1) {
      aux = ret;
      mult(ret, aux, P);
    }
    n >>= 1;
    aux = P;
    mult(P, aux, aux);
  }
  return ret;
}
int main() {
  size = 128;
  int n, x;
  while (cin >> n >> x) {
    double p[128];
    for (int i = 0; i < 128; i++) p[i] = 0;
    for (int i = 0; i <= x; i++) cin >> p[i];
    if (n == 1) {
      printf("%.10lf\n", 1 - p[0]);
      continue;
    }
    Matrix m;
    for (int i = 0; i < 128; i++) {
      for (int j = 0; j < 128; j++) {
        m.X[i][j] = p[i ^ j];
      }
    }
    m = pow(m, n);
    printf("%.10lf\n", 1 - m.X[0][0]);
  }
  return 0;
}
