#include <bits/stdc++.h>   using namespace std;   inline int ckmax(int &a, int b) { return a < b ? a = b, 1 : 0; }   inline int ckmin(int &a, int b) { return a > b ? a = b, 1 : 0; }   struct matrix {     double x[128][128];     double *operator[](int a) { return x[a]; }     void clear() { memset(x, 0, sizeof(x)); }     void reset() {       clear();       for (int i = 0; i < 128; ++i) x[i][i] = 1;     }   } p, a, ans;   matrix operator*(matrix &a, matrix &b) {     p.clear();     for (int i = 0; i < 128; i++)       for (int j = 0; j < 128; j++)         for (int k = 0; k < 128; k++) p[i][j] += a[i][k] * b[k][j];     return p;   }   int n, x;   double pos[128];   int main() {     scanf( %d%d , &n, &x);     for (int i = 0; i <= x; ++i) scanf( %lf , &pos[i]);     a.clear();     for (int i = 0; i < 128; ++i)       for (int j = 0; j < 128; ++j) a[i][j] = pos[i ^ j];     ans.reset();     for (; n; n >>= 1, a = a * a)       if (n & 1) ans = ans * a;     printf( %.10f n , 1.0 - double(ans[0][0]));     return 0;   }   