#include <bits/stdc++.h>
using namespace std;
inline long long rd() {
  long long x = 0;
  int ch = getchar(), f = 1;
  while (!isdigit(ch) && (ch != '-') && (ch != EOF)) ch = getchar();
  if (ch == '-') {
    f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void rt(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10)
    rt(x / 10), putchar(x % 10 + '0');
  else
    putchar(x + '0');
}
const int maxn = 130;
int N;
double a[maxn][maxn], b[maxn][maxn], c[maxn][maxn], p[maxn];
void pow(int x) {
  if (x == 1) {
    for (int i = 0; i <= (int)N; i++)
      for (int j = 0; j <= (int)N; j++) c[i][j] = a[i][j];
    return;
  }
  pow(x >> 1);
  memset(b, 0, sizeof b);
  for (int k = 0; k <= (int)N; k++)
    for (int i = 0; i <= (int)N; i++)
      for (int j = 0; j <= (int)N; j++) b[i][j] += c[i][k] * c[k][j];
  if (x & 1) {
    memset(c, 0, sizeof c);
    for (int k = 0; k <= (int)N; k++)
      for (int i = 0; i <= (int)N; i++)
        for (int j = 0; j <= (int)N; j++) c[i][j] += b[i][k] * a[k][j];
  } else
    memcpy(c, b, sizeof c);
}
int n, x;
int main() {
  n = rd(), x = rd();
  for (int i = 0; i <= (int)x; i++) scanf("%lf", &p[i]);
  for (N = 1; N <= x; N <<= 1)
    ;
  N--;
  for (int i = 0; i <= (int)N; i++)
    for (int j = 0; j <= (int)x; j++) a[i][i ^ j] = p[j];
  pow(n);
  double ans = 0;
  printf("%.8lf\n", 1 - c[0][0]);
}
