#include <bits/stdc++.h>
using namespace std;
const int DIM = 128;
struct matrix {
  long double val[DIM][DIM];
  matrix() { memset(val, 0, sizeof(val)); }
};
matrix mul(matrix a, matrix b) {
  matrix c;
  for (int i = 0; i < DIM; i++) {
    for (int j = 0; j < DIM; j++) {
      for (int k = 0; k < DIM; k++) {
        c.val[i][j] += a.val[i][k] * b.val[k][j];
      }
    }
  }
  return c;
}
matrix power(matrix a, int n) {
  matrix ret;
  for (int i = 0; i < DIM; i++) {
    ret.val[i][i] = 1;
  }
  while (n > 0) {
    if (n & 1) {
      ret = mul(ret, a);
    }
    a = mul(a, a);
    n >>= 1;
  }
  return ret;
}
int main() {
  int n, x;
  cin >> n >> x;
  long double prob[130];
  memset(prob, 0, sizeof(prob));
  for (int i = 0; i <= x; i++) {
    cin >> prob[i];
  }
  matrix mat;
  for (int i = 0; i < 128; i++) {
    for (int j = 0; j < 128; j++) {
      mat.val[i][i ^ j] += prob[j];
    }
  }
  matrix ans = power(mat, n);
  cout << 1 - ans.val[0][0];
}
