long a,b,s,x=1e9+7;main(i){for(;~scanf("%ld",&b);a=b)i++%2?s-=~a/2%x*(b%x),s%=x:0;a=!printf("%d",s);}