#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.141592653589793238462643383279502884L;
const long double E = 2.718281828459045235360287471352662498L;
const long double EPS = 1e-12L;
map<int, array<long double, 256>> b;
array<long double, 256> p(int n) {
  if (b.count(n)) {
    return b[n];
  }
  if (n % 2 == 1) {
    array<long double, 256> e = p(n - 1);
    array<long double, 256> c = {};
    for (int i = 0; i < 256; ++i) {
      for (int j = 0; j < 256; ++j) {
        c[i ^ j] += b[1][i] * e[j];
      }
    }
    b[n] = c;
    return b[n];
  } else {
    array<long double, 256> e = p(n / 2);
    array<long double, 256> c = {};
    for (int i = 0; i < 256; ++i) {
      for (int j = 0; j < 256; ++j) {
        c[i ^ j] += e[i] * e[j];
      }
    }
    b[n] = c;
    return b[n];
  }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(11);
  cout.setf(ios::fixed);
  int n, x;
  cin >> n >> x;
  for (int i = 0; i <= x; ++i) {
    cin >> b[1][i];
  }
  array<long double, 256> c = p(n);
  cout << 1.0L - c[0] << endl;
  return 0;
}
