#include <bits/stdc++.h>
using namespace std;
int N, X;
vector<double> p(256), ans(256);
void input() {
  scanf("%d %d", &N, &X);
  X++;
  for (int i = 0; i < X; i++) scanf("%lf", &p[i]);
}
vector<double> newArrayFromMultOperation(vector<double>& a, vector<double>& b) {
  vector<double> c(256);
  for (int i = 0; i < 128; i++)
    for (int j = 0; j < 128; j++) c[i ^ j] += a[i] * b[j];
  return c;
}
vector<double> fastPow(vector<double>& p1, int n) {
  if (n == 1)
    return p1;
  else if (n % 2) {
    vector<double> tmp = fastPow(p1, n - 1);
    return newArrayFromMultOperation(p1, tmp);
  } else {
    vector<double> tmp = newArrayFromMultOperation(p1, p1);
    return fastPow(tmp, n / 2);
  }
}
void solve() {
  vector<double> ans = fastPow(p, N);
  cout << 1 - ans[0] << endl;
}
int main() {
  input();
  solve();
  return 0;
}
