ll N,a;mint c,z;{rd(N);c=1;rep(i,N){rd(a);z+=c*a;c*=N+~i;c/=i+1;}wt(z);}