#include #include using namespace std; typedef vector vi; typedef long long ll; const ll mod=1e9+7; int n; vi a,b; int main(){ cin>>n; a=b=vi(n); for(int i=0;i>t; a[t-1]=i; } for(int i=0;i>t; b[t-1]=i; } ll res=0; for(int i=0;i