#include <bits/stdc++.h>
using namespace std;
const int N = 128;
int n, x;
double P[N];
double A[N][N];
double B[N][N];
double c[N][N];
void mul(double a[][N], double b[][N]) {
  for (long long i = 0; i < N; i++) {
    for (long long j = 0; j < N; j++) {
      c[i][j] = 0;
      for (long long k = 0; k < N; k++) c[i][j] += a[i][k] * b[k][j];
    }
  }
  for (long long i = 0; i < N; i++)
    for (long long j = 0; j < N; j++) a[i][j] = c[i][j];
}
void power(int n) {
  while (n) {
    if (n & 1) mul(B, A);
    mul(A, A);
    n >>= 1;
  }
}
int main() {
  scanf("%d%d", &n, &x);
  for (long long i = 0; i < x + 1; i++) {
    scanf("%lf", P + i);
  }
  for (long long i = 0; i < N; i++) {
    B[i][i] = 1;
    for (long long j = 0; j < N; j++) A[i][j] = P[i ^ j];
  }
  power(n);
  printf("%.8lf\n", 1 - B[0][0]);
  return 0;
}
