#include <bits/stdc++.h>
using namespace std;
const int N = 105;
const int M = 140;
int n, x;
double p[M];
double A[M][M], b[M][M];
double ans[M][M];
void times1() {
  memset(b, 0, sizeof(b));
  for (int i = 0; i <= 127; i++) {
    for (int j = 0; j <= 127; j++) {
      for (int k = 0; k <= 127; k++) {
        b[i][j] += double(A[i][k] * A[k][j]);
      }
    }
  }
  for (int i = 0; i <= 127; i++) {
    for (int j = 0; j <= 127; j++) {
      A[i][j] = b[i][j];
    }
  }
}
void times2() {
  memset(b, 0, sizeof(b));
  for (int i = 0; i <= 127; i++) {
    for (int j = 0; j <= 127; j++) {
      for (int k = 0; k <= 127; k++) b[i][j] += (ans[i][k] * A[k][j]);
    }
  }
  for (int i = 0; i <= 127; i++)
    for (int j = 0; j <= 127; j++) ans[i][j] = b[i][j];
}
int main() {
  memset(A, 0, sizeof(A));
  memset(ans, 0, sizeof(ans));
  cin >> n >> x;
  for (int i = 0; i <= x; i++) cin >> p[i];
  for (int i = 0; i <= 127; i++) {
    for (int j = 0; j <= 127; j++) {
      A[i][j] = p[i ^ j];
    }
  }
  for (int i = 0; i <= 127; i++) ans[i][i] = 1;
  while (n) {
    if (n & 1) times2();
    times1();
    n >>= 1;
  }
  cout << 1 - ans[0][0];
  return 0;
}
