#include <bits/stdc++.h>
using namespace std;
const int SIZE = 128;
double p[SIZE][SIZE];
double tmp[SIZE][SIZE];
void print(double m[SIZE][SIZE]) {
  for (int i = 0; i < SIZE; i++) {
    for (int j = 0; j < SIZE; j++) {
      cout << m[i][j] << ' ';
    }
    cout << endl;
  }
}
void power(double m[SIZE][SIZE], int n) {
  for (int i = 0; i < SIZE; i++) p[i][i] = 1;
  while (n > 0) {
    if (n % 2 != 0) {
      for (int i = 0; i < SIZE; i++)
        for (int j = 0; j < SIZE; j++)
          for (int k = 0; k < SIZE; k++) tmp[i][k] += p[i][j] * m[j][k];
      for (int i = 0; i < SIZE; i++)
        for (int j = 0; j < SIZE; j++) {
          p[i][j] = tmp[i][j];
          tmp[i][j] = 0;
        }
    }
    for (int i = 0; i < SIZE; i++)
      for (int j = 0; j < SIZE; j++)
        for (int k = 0; k < SIZE; k++) tmp[i][k] += m[i][j] * m[j][k];
    for (int i = 0; i < SIZE; i++)
      for (int j = 0; j < SIZE; j++) {
        m[i][j] = tmp[i][j];
        tmp[i][j] = 0;
      }
    n /= 2;
  }
}
double m[SIZE][SIZE];
double pr[SIZE];
int main() {
  int n, x;
  cin >> n >> x;
  double sum = 0;
  for (int i = 0; i <= x; i++) {
    cin >> pr[i];
    sum += pr[i];
  }
  for (int i = 0; i <= x; i++) pr[i] /= sum;
  for (int i = 0; i < SIZE; i++) {
    for (int j = 0; j < SIZE; j++) {
      m[i][j] = pr[i ^ j];
    }
  }
  power(m, n);
  printf("%.15f", 1 - p[0][0]);
}
