#include <bits/stdc++.h>
using namespace std;
long double bi(long double p[500], long long int n, long long int g) {
  long double res[500];
  res[0] = 1.0000;
  for (int x = 1; x < 500; x++) {
    res[x] = 0.0000;
  }
  long double temp[500];
  while (n > 0) {
    if (n & 1) {
      for (int x = 0; x < 500; x++) {
        temp[x] = res[x];
        res[x] = 0.000;
      }
      for (int x = 0; x <= 200; x++) {
        for (int y = 0; y <= 200; y++) {
          res[x ^ y] += temp[x] * p[y];
        }
      }
    }
    for (int x = 0; x < 500; x++) {
      temp[x] = p[x];
      p[x] = 0.0000;
    }
    for (int x = 0; x <= 200; x++)
      for (int y = 0; y <= 200; y++) {
        p[x ^ y] += temp[x] * temp[y];
      }
    n >>= 1;
  }
  return res[0];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, x;
  cin >> n >> x;
  long double p[500];
  for (int i = 0; i < 500; i++) p[i] = 0.0000;
  for (int i = 0; i <= x; i++) cin >> p[i];
  cout << fixed;
  cout << setprecision(9) << 1 - bi(p, n, x);
}
