#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:200000000")
using namespace std;
struct _ {
  _() {
    cout.precision(30);
    ios_base::sync_with_stdio(0);
  }
} __;
const int X = 128;
struct mat {
  mat() {
    for (int i = 0; i < X; i++) {
      for (int j = 0; j < X; j++) {
        m[i][j] = 0;
      }
    }
  }
  double m[X][X];
  mat operator*(mat a) {
    mat result;
    for (int i = 0; i < X; i++) {
      for (int j = 0; j < X; j++) {
        for (int k = 0; k < X; k++) {
          result.m[i][j] += m[i][k] * a.m[k][j];
        }
      }
    }
    return result;
  }
};
mat pow(mat sq, int n) {
  mat result;
  for (int i = 0; i < X; i++) {
    result.m[i][i] = 1;
  }
  while (n > 0) {
    if (n & 1) {
      result = result * sq;
    }
    n >>= 1;
    sq = sq * sq;
  }
  return result;
}
double p[X];
int main() {
  int n, x;
  cin >> n >> x;
  for (int i = 0; i <= x; i++) {
    cin >> p[i];
  }
  mat m;
  for (int col = 0; col < X; col++) {
    for (int row = 0; row < X; row++) {
      m.m[col][row] = p[row ^ col];
    }
  }
  m = pow(m, n);
  cout << (1 - m.m[0][0]) << endl;
  return 0;
}
