#include <bits/stdc++.h>
using namespace std;
inline long long qr() {
  long long x = 0, f = 1;
  char ch;
  while (!isdigit(ch = getchar()))
    if (ch == '-') f = -1;
  for (; isdigit(ch); x = x * 10 + ch - 48, ch = getchar())
    ;
  return x * f;
}
void mul(double a[][128], double b[][128]) {
  double c[128][128] = {0};
  for (int i = 0; i <= 127; ++i)
    for (int j = 0; j <= 127; ++j)
      for (int k = 0; k <= 127; ++k) c[i][j] += a[i][k] * b[k][j];
  for (int i = 0; i <= 127; ++i)
    for (int j = 0; j <= 127; ++j) a[i][j] = c[i][j];
}
double a[128][128], b[128][128];
void ksm(double a[][128], int n) {
  for (int i = 0; i <= 127; ++i) b[i][i] = 1;
  for (; n; n >>= 1, mul(a, a))
    if (n & 1) mul(b, a);
  for (int i = 0; i <= 127; ++i)
    for (int j = 0; j <= 127; ++j) a[i][j] = b[i][j];
}
int n, x;
double p[101];
int main() {
  n = qr(), x = qr();
  for (int i = 0; i <= x; ++i) scanf("%lf", p + i);
  for (int i = 0; i <= 127; ++i)
    for (int j = 0; j <= x; ++j) a[i ^ j][i] = p[j];
  ksm(a, n);
  printf("%.8lf\n", 1 - a[0][0]);
}
