#include <bits/stdc++.h>
using namespace std;
const int DIM = 130;
struct Matrix {
  long double a[DIM][DIM];
  long double *operator[](int r) { return a[r]; };
  Matrix(long double x = 0) {
    memset(a, 0, sizeof a);
    if (x)
      for (int i = (int)(0); i < (int)(DIM); i++) a[i][i] = x;
  }
} const I(1);
Matrix operator*(Matrix A, Matrix B) {
  Matrix C;
  for (int i = (int)(0); i < (int)(DIM); i++)
    for (int j = (int)(0); j < (int)(DIM); j++) {
      long double w = 0;
      for (int k = (int)(0); k < (int)(DIM); k++) {
        w += (long double)(A[i][k]) * B[k][j];
      }
      C[i][j] = w;
    }
  return C;
}
Matrix operator^(Matrix A, long long b) {
  Matrix R = I;
  for (; b > 0; b /= 2) {
    if (b % 2) R = R * A;
    A = A * A;
  }
  return R;
}
long double p[DIM];
int main() {
  ios_base::sync_with_stdio(false);
  int n, x;
  cin >> n >> x;
  for (int i = 0; i <= x; i++) {
    cin >> p[i];
  }
  Matrix baza;
  for (int i = 0; i <= 127; i++) {
    for (int j = 0; j <= x; j++) {
      baza[i][i ^ j] += p[j];
    }
  }
  baza = baza ^ n;
  cout << setprecision(20) << fixed << (1.0 - baza[0][0]) << endl;
  return 0;
}
