#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
long long add(long long a, long long b) {
  long long ret = a + b;
  if (ret >= 1000000007) ret -= 1000000007;
  return ret;
}
long long subtract(long long a, long long b) {
  long long ret = a - b;
  if (ret < 0) ret += 1000000007;
  return ret;
}
long long mult(long long a, long long b) {
  long long ret = a * b;
  if (ret >= 1000000007) ret %= 1000000007;
  return ret;
}
long long bigmod(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret = mult(ret, a);
    b >>= 1;
    a = mult(a, a);
  }
  return ret;
}
long long inverse(long long n) { return bigmod(n, 1000000007 - 2); }
bool base[1000010];
vector<int> primes;
void sieve(int mx) {
  mx += 10;
  int x = sqrt(mx);
  for (int i = 3; i <= x; i += 2)
    if (base[i] == 0)
      for (int j = i * i, k = i << 1; j < mx; j += k) base[j] = 1;
  primes.push_back(2);
  for (int i = 3; i < mx; i += 2)
    if (base[i] == 0) primes.push_back(i);
}
bool checkBit(int n, int i) { return (n & (1 << i)); }
int setBit(int n, int i) { return (n | (1 << i)); }
int resetBit(int n, int i) { return (n & (~(1 << i))); }
struct mat {
  double a[128][128];
  mat() {
    for (int i = 0; i < 128; ++i)
      for (int j = 0; j < 128; ++j) a[i][j] = 0;
  }
  void init() {
    for (int i = 0; i < 128; ++i) a[i][i] = 1;
  }
  mat operator*(const mat &b) const {
    mat ret;
    for (int i = 0; i < 128; ++i)
      for (int j = 0; j < 128; ++j)
        for (int k = 0; k < 128; ++k) ret.a[i][j] += a[i][k] * b.a[k][j];
    return ret;
  }
};
mat power(mat a, long long b) {
  mat ret;
  ret.init();
  while (b) {
    if (b & 1) ret = ret * a;
    b >>= 1;
    a = a * a;
  }
  return ret;
}
double p[130];
int main() {
  int n, x;
  scanf("%d%d", &n, &x);
  for (int i = 0; i < x + 1; ++i) scanf("%lf", &p[i]);
  mat A;
  for (int i = 0; i < 128; ++i)
    for (int j = 0; j < 128; ++j) A.a[i][j] = p[i ^ j];
  A = power(A, n);
  printf("%.10lf\n", 1.0 - A.a[0][0]);
  return 0;
}
