#include <bits/stdc++.h>
using namespace std;
int n, x;
double p[512], a[512][512], ans;
double rez[512][512];
double r[512][512];
void inm(double mat[][512], double mat2[][512]) {
  int i, j, k;
  for (i = 0; i <= 200; i++)
    for (j = 0; j <= 200; j++) {
      r[i][j] = 0;
      for (k = 0; k <= 200; k++) r[i][j] += mat[i][k] * mat2[k][j];
    }
  for (i = 0; i <= 200; i++)
    for (j = 0; j <= 200; j++) mat[i][j] = r[i][j];
}
int main() {
  int i, j, b;
  std::ios::sync_with_stdio(false);
  cin >> n >> x;
  for (i = 0; i <= x; i++) cin >> p[i];
  for (i = 0; i <= 200; i++)
    for (j = 0; j <= 200; j++) a[i][j] = p[i ^ j];
  b = n - 1;
  for (i = 0; i <= 200; i++)
    for (j = 0; j <= 200; j++)
      if (i == j)
        rez[i][j] = 1;
      else
        rez[i][j] = 0;
  while (b != 0) {
    if (b % 2) inm(rez, a);
    b /= 2;
    inm(a, a);
  }
  for (i = 0; i <= 200; i++)
    for (j = 0; j <= 200; j++) a[i][j] = rez[i][j];
  for (i = 0; i <= 200; i++) ans += a[0][i] * p[i];
  ans = 1 - ans;
  cout << fixed << setprecision(9) << ans;
  return 0;
}
