#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const int mod=1e9+7; int main(){ int n,a[100001],b; cin>>n; int sum=0; for(int i=0;i<=n;i++){ cin>>a[i]; (sum+=a[i])%=mod; } int ans=0; for(int i=0;i<=n;i++){ cin>>b; (ans+=(ll)b*sum%mod)%=mod; (sum+=mod-a[n-i])%=mod; } cout<