#include <bits/stdc++.h>
using namespace std;
const int N = 110;
const int M = 200;
double p[N];
double ans[M], tmp[M];
int n, x;
void calc(int n) {
  if (n == 1) {
    for (int i = 0; i <= x; i++) ans[i] = p[i];
    return;
  }
  if (n % 2 == 0) {
    calc(n / 2);
    memcpy(tmp, ans, sizeof(ans));
    memset(ans, 0, sizeof(ans));
    for (int i = 0; i < M; i++)
      for (int j = 0; j < M; j++) ans[i ^ j] += tmp[i] * tmp[j];
  } else {
    calc((n - 1) / 2);
    memcpy(tmp, ans, sizeof(ans));
    memset(ans, 0, sizeof(ans));
    for (int i = 0; i < M; i++)
      for (int j = 0; j < M; j++) ans[i ^ j] += tmp[i] * tmp[j];
    memcpy(tmp, ans, sizeof(ans));
    memset(ans, 0, sizeof(ans));
    for (int i = 0; i < M; i++)
      for (int j = 0; j <= x; j++) ans[i ^ j] += tmp[i] * p[j];
  }
}
int main() {
  scanf("%d%d", &n, &x);
  for (int i = 0; i <= x; i++) scanf("%lf", &p[i]);
  calc(n);
  printf("%.8f\n", 1 - ans[0]);
  return 0;
}
