#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const double PI = acos(-1.);
const double eps = 1e-9;
long long modPow(long long a, long long b, long long MOD) {
  long long ret = 1;
  for (; b; b >>= 1) {
    if (b & 1) ret = ret * a % MOD;
    a = a * a % MOD;
  }
  return ret;
}
const int MXN = 100005;
double p[255], q[255], t[255];
void play(double *p, double *q, double *r) {
  for (int i = (0); i < (int)(128); i++) t[i] = 0;
  for (int i = (0); i < (int)(128); i++)
    for (int j = (0); j < (int)(128); j++) t[i ^ j] += p[i] * q[j];
  for (int i = (0); i < (int)(128); i++) r[i] = t[i];
}
void solve() {
  for (int i = (0); i < (int)(128); i++) p[i] = q[i] = 0;
  q[0] = 1;
  int(n);
  scanf("%d", &n);
  int(x);
  scanf("%d", &x);
  for (int i = (0); i < (int)(x + 1); i++) scanf("%lf", &p[i]);
  while (n) {
    if (n & 1) play(p, q, q);
    play(p, p, p);
    n >>= 1;
  }
  printf("%.16f\n", 1. - q[0]);
}
int main() {
  int _T = 1;
  for (int CA = (0); CA < (int)(_T); CA++) {
    solve();
  }
  return 0;
}
