#include <bits/stdc++.h>
using namespace std;
void transform(vector<long double> &a, int l, int r) {
  if (r - l == 1) return;
  int n = (r - l) / 2;
  int m = (l + r) / 2;
  transform(a, l, m);
  transform(a, m, r);
  for (int i = 0; i < n; i++) {
    long double x = a[l + i], y = a[m + i];
    a[l + i] = x + y;
    a[m + i] = x - y;
  }
}
int main() {
  int n, x;
  cin >> n >> x;
  vector<long double> p(128);
  for (int i = 0; i <= x; i++) {
    cin >> p[i];
  }
  vector<long double> dp(128);
  dp[0] = 1;
  transform(p, 0, 128);
  transform(dp, 0, 128);
  for (int i = 0; i < 128; i++) {
    dp[i] *= powl(p[i], n);
  }
  transform(dp, 0, 128);
  printf("%.20f\n", (double(1 - dp[0] / 128)));
}
