#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct Matrix {
  vector<vector<T> > A;
  long long int rows, cols;
  Matrix() : rows(0), cols(0) {}
  Matrix(long long int n, long long int m) : rows(n), cols(m) {
    A.assign(n, vector<T>(m, 0));
  }
  vector<T> &operator[](int i) { return A[i]; }
  const vector<T> &operator[](int i) const { return A[i]; }
  static Matrix Identity(long long int n) {
    Matrix<T> I(n, n);
    for (int i = 0; i < n; i++) I[i][i] = 1;
    return I;
  }
  Matrix operator*(const Matrix &B) const {
    assert(cols == B.rows);
    Matrix<T> C(rows, B.cols);
    for (int i = 0; i < rows; i++)
      for (int j = 0; j < B.cols; j++)
        for (int k = 0; k < cols; k++) C[i][j] += (A[i][k] * B[k][j]);
    return C;
  }
  Matrix operator^(long long int e) const {
    Matrix<T> res = Matrix<T>::Identity(rows);
    Matrix<T> aux = *this;
    while (e) {
      if (e & 1) res = res * aux;
      e >>= 1;
      aux = aux * aux;
    }
    return res;
  }
  void printMatrix() {
    for (int i = 0; i < rows; i++) {
      cout << "|";
      for (int j = 0; j < cols; j++) {
        cout << A[i][j] << (j != cols - 1 ? " " : "");
      }
      cout << "|\n";
    }
    cout << '\n';
  }
};
int main() {
  ;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n, X;
  cin >> n >> X;
  vector<long double> prob(X + 1);
  for (auto &p : prob) cin >> p;
  const long long int maxXOR = 127;
  Matrix<long double> A(maxXOR + 1, maxXOR + 1);
  for (int i = 0; i <= maxXOR; i++) {
    for (int j = 0; j <= X; j++) {
      if ((i ^ j) > 128) continue;
      A[i][i ^ j] = prob[j];
    }
  }
  A = A ^ (n);
  cout << fixed << setprecision(10) << (long double)(1 - A[0][0]) << '\n';
  return 0;
}
