#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, x;
long double p[N];
map<pair<int, int>, long double> memo;
long double solve(int n, int val) {
  auto cur = make_pair(n, val);
  if (memo.count(cur)) {
    return memo[cur];
  }
  if (n == 1) {
    if (val > x) return 0;
    return p[val];
  }
  long double result = 0;
  for (int a = 0; a < 128; ++a) {
    int b = val ^ a;
    if (n & 1)
      result += solve(n - 1, a) * solve(1, b);
    else
      result += solve(n / 2, a) * solve(n / 2, b);
  }
  return memo[cur] = result;
}
int main() {
  cin >> n >> x;
  for (int i = 0; i <= x; ++i) {
    cin >> p[i];
  }
  cout << setprecision(12) << fixed << 1.0 - solve(n, 0) << endl;
  return 0;
}
