#include <bits/stdc++.h>
using namespace std;
int n, k;
struct matrix {
  double m[130];
  void clr() {
    for (int i = 0; i <= 127; i++) {
      m[i] = 0.0;
    }
  }
  void init() {
    for (int i = 0; i <= 127; i++) {
      m[i] = 1.0;
    }
  }
};
void print(matrix x) {
  for (int i = 0; i <= n; i++) {
    printf("%6lf ", x.m[i]);
  }
  puts("");
}
matrix mul(matrix a, matrix b) {
  matrix ans;
  ans.clr();
  for (int i = 0; i <= 127; i++) {
    for (int j = 0; j <= 127; j++) {
      ans.m[i ^ j] += a.m[i] * b.m[j];
    }
  }
  return ans;
}
matrix kasumi(matrix a, int b) {
  matrix ans = a;
  while (b) {
    if (b & 1) {
      ans = mul(ans, a);
    }
    a = mul(a, a);
    b >>= 1;
  }
  return ans;
}
int main() {
  matrix a;
  a.clr();
  scanf("%d%d", &k, &n);
  for (int i = 0; i <= n; i++) {
    scanf("%lf", &a.m[i]);
  }
  a = kasumi(a, k - 1);
  printf("%.6lf", 1.0 - a.m[0]);
}
