#include <bits/stdc++.h>
using namespace std;
vector<vector<long double>> mult(vector<vector<long double>> &a,
                                 vector<vector<long double>> &b, int n) {
  vector<vector<long double>> ans =
      vector<vector<long double>>(n, vector<long double>(n, 0));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      for (int k = 0; k < n; k++) ans[i][j] += a[i][k] * b[k][j];
  return ans;
}
void solve() {
  int n, x;
  cin >> n >> x;
  vector<long double> p;
  int y = 0;
  for (int i = 0; i < 30; i++) {
    if ((1 << i) > x) {
      y = (1 << i) - 1;
      break;
    }
  }
  p.resize(y + 1);
  for (int i = 0; i <= x; i++) cin >> p[i];
  vector<vector<long double>> mat(y + 1, vector<long double>(y + 1, 0));
  for (int i = 0; i <= y; i++)
    for (int j = 0; j <= y; j++) mat[i][j] = p[i ^ j];
  vector<vector<long double>> ans(y + 1, vector<long double>(y + 1, 0));
  for (int i = 0; i <= y; i++) ans[i][i] = 1;
  while (n > 0) {
    if (n & 1) ans = mult(ans, mat, y + 1);
    mat = mult(mat, mat, y + 1);
    n >>= 1;
  }
  printf("%.9Lf\n", 1 - ans[0][0]);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
