#include <bits/stdc++.h>
using namespace std;
const int N = 11000;
double a[N], ans[N];
int n, x;
void mul(double a[], double b[]) {
  double t[N] = {0};
  for (int i = 0; i < x * 2; i++)
    for (int j = 0; j < x * 2; j++) t[i ^ j] += a[i] * b[j];
  for (int i = 0; i < N; i++) a[i] = t[i];
}
int main() {
  scanf("%d%d", &n, &x);
  for (int i = 0; i <= x; i++) scanf("%lf ", a + i);
  ans[0] = 1;
  while (n) {
    if (n & 1) mul(ans, a);
    n >>= 1;
    mul(a, a);
  }
  printf("%lf", 1.0 - ans[0]);
  return 0;
}
