#include <bits/stdc++.h>
using namespace std;
const int maxx = 128;
inline vector<double> operator*(const vector<double> &p,
                                const vector<double> &q) {
  vector<double> res(128);
  for (int i = 0; i < maxx; ++i) {
    for (int j = 0; j < maxx; ++j) {
      res[i ^ j] += p[i] * q[j];
    }
  }
  return res;
}
vector<double> pow(const vector<double> &p, int n) {
  if (n == 1) return p;
  vector<double> c = pow(p, n / 2);
  c = c * c;
  if (n & 1) c = c * p;
  return c;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, x;
  cin >> n >> x;
  vector<double> a(128);
  for (int i = 0; i <= x; ++i) cin >> a[i];
  a = pow(a, n);
  cout.precision(10);
  cout << fixed << 1 - a[0] << endl;
  return 0;
}
