#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 100, INF = 1e9 + 7, P = 1e9 + 7;
long long n, m;
long double d[1001];
const int MAX = 200;
struct matrix {
  long double t[MAX + 10][MAX + 10];
  matrix() {}
  long double* operator[](int n) { return t[n]; }
  friend matrix operator*(matrix a, matrix b) {
    matrix c;
    for (int i = 0; i <= MAX; i++) {
      for (int j = 0; j <= MAX; j++) {
        c[i][j] = 0;
        for (int l = 0; l <= MAX; l++) {
          c[i][j] += (a[i][l] * b[l][j]);
        }
      }
    }
    return c;
  }
} x, y;
matrix pow(int n) {
  if (n == 1) return x;
  if (n % 2 == 0) {
    matrix x = pow(n / 2);
    return x * x;
  } else {
    return x * pow(n - 1);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i <= m; i++) {
    cin >> d[i];
  }
  for (int i = 0; i <= MAX; i++) {
    for (int j = 0; j <= MAX; j++) {
      x[i][j] = d[i ^ j];
    }
  }
  y = pow(n);
  printf("%.10Lf", 1.0 - y[0][0]);
}
