#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  cin >> n >> x;
  vector<double> child(128, 0);
  for (int i = 0; i < x + 1; i++) {
    cin >> child[i];
  }
  vector<double> krill[35];
  krill[0] = child;
  for (int i = 1; i < 35; i++) {
    krill[i] = vector<double>(128, 0);
    for (int j = 0; j < 128; j++) {
      for (int l = 0; l < 128; l++) {
        krill[i][j ^ l] += (krill[i - 1][j] * krill[i - 1][l]);
      }
    }
  }
  vector<double> distSoFar;
  int setsofar = 0;
  int ric = n;
  for (int i = 0; i < 35; i++) {
    if (ric % 2) {
      if (setsofar == 1) {
        vector<double> newdist(128, 0);
        for (int j = 0; j < 128; j++) {
          for (int l = 0; l < 128; l++) {
            newdist[j ^ l] += distSoFar[j] * krill[i][l];
          }
        }
        distSoFar = newdist;
      } else {
        distSoFar = krill[i];
        setsofar = 1;
      }
    }
    ric = ric >> 1;
  }
  cout << setprecision(9) << 1 - distSoFar[0] << endl;
  return 0;
}
