#include <bits/stdc++.h>
using namespace std;
double p[100];
double sum = 0;
int x;
double dp[128][32];
bool vis[128][32];
double calc(int n, int k, int steps) {
  if (vis[k][steps]) return dp[k][steps];
  if (n == 1 && k <= x) return p[k];
  if (n == 1 && k > x) return 0;
  for (int i = 0; i < 128; ++i) dp[i][steps + 1] = calc(n / 2, i, steps + 1);
  if (n % 2 == 0) {
    int i, j;
    for (i = 0; i < 128; ++i)
      for (j = 0; j < 128; ++j) {
        dp[i ^ j][steps] += dp[i][steps + 1] * dp[j][steps + 1];
        vis[i ^ j][steps] = true;
      }
  } else {
    int i, j, k;
    for (i = 0; i < 128; ++i)
      for (j = 0; j < 128; ++j)
        for (k = 0; k < 128; ++k) {
          dp[i ^ j ^ k][steps] += dp[i][steps + 1] * dp[j][steps + 1] * p[k];
          vis[i ^ j ^ k][steps] = true;
        }
  }
  vis[k][steps] = true;
  return dp[k][steps];
}
int main() {
  int i, j, k, n;
  cin >> n >> x;
  for (i = 0; i <= x; ++i) {
    scanf("%lf", &p[i]);
    sum += p[i];
  }
  double ans = calc(n, 0, 0);
  cout << setprecision(8) << 1 - ans << endl;
  return 0;
}
