#include <bits/stdc++.h>
using namespace std;
long double p[10000];
int n, x;
map<pair<int, int>, long double> d;
map<pair<int, int>, int> ob;
long double fast(int st, int num) {
  long double ans = 0;
  if (ob[{st, num}] != 0) return d[{st, num}];
  if (st == 1) {
    ob[{1, num}] = 1;
    d[{1, num}] = p[num];
    return p[num];
  }
  for (int i = 0; i < 128; i++)
    ans += fast(st / 2, i) * fast(st - st / 2, num ^ i);
  ob[{st, num}] = 1;
  d[{st, num}] = ans;
  return ans;
}
int main() {
  scanf("%d%d", &n, &x);
  for (int i = 0; i <= x; i++) cin >> p[i];
  long double ans = fast(n, 0);
  cout << 1 - ans << "\n";
  return 0;
}
