#include <bits/stdc++.h>
using namespace std;
struct node {
  long long n, m;
  double a[205][205];
  node operator*(const node &b) {
    node c;
    c.n = n;
    c.m = b.m;
    for (int i = 0; i <= n; i++) {
      for (int j = 0; j <= b.m; j++) {
        c.a[i][j] = 0;
        for (int k = 0; k <= m; k++) {
          c.a[i][j] += a[i][k] * b.a[k][j];
        }
      }
    }
    return c;
  }
} fas, init;
long long n;
int x;
double p[205];
node qkpow(node a, long long b) {
  if (b == 1) return init;
  node t = qkpow(a, b / 2);
  t = t * t;
  if (b % 2 == 1) t = t * fas;
  return t;
}
int main() {
  cin >> n >> x;
  for (int i = 0; i <= x; i++) cin >> p[i];
  fas.n = 127;
  fas.m = 127;
  for (int i = 0; i < 128; i++)
    for (int j = 0; j <= x; j++) fas.a[i ^ j][i] = p[j];
  init = fas;
  fas = qkpow(fas, n);
  printf("%.8lf", 1 - fas.a[0][0]);
  return 0;
}
