use bigint;/ /,$a+=$'*($`+$`%2)/2for<>;print$a%=1e9+7