There are N computers and N sockets in a one-dimensional world. The coordinate of the i-th computer is a_i, and the coordinate of the i-th socket is b_i. It is guaranteed that these 2N coordinates are pairwise distinct.

Snuke wants to connect each computer to a socket using a cable. Each socket can be connected to only one computer.

In how many ways can he minimize the total length of the cables? Compute the answer modulo 10^9+7.

Constraints

* 1 ≤ N ≤ 10^5
* 0 ≤ a_i, b_i ≤ 10^9
* The coordinates are integers.
* The coordinates are pairwise distinct.

Input

The input is given from Standard Input in the following format:


N
a_1
:
a_N
b_1
:
b_N


Output

Print the number of ways to minimize the total length of the cables, modulo 10^9+7.

Examples

Input

2
0
10
20
30


Output

2


Input

3
3
10
8
7
12
5


Output

1
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
ll mod=1000000007;
ll gyaku(ll n){
  ll y=mod-2;
  ll now=n;
  ll ret=1;
  while(y>0){
    if(y%2==1)ret*=now;
    now*=now;
    ret%=mod;
    now%=mod;
    y/=2;
  }
  return ret;
}
ll nck(ll n,ll k){
  if(2*k>n)k=n-k;
  ll ret=1;
  for(ll i=0;i<k;i++){
    ret*=n-i;
    ret%=mod;
    ret*=gyaku(i+1);
    ret%=mod;
  }
  return ret;
}
int main(){
  ll n;cin>>n;
  vector<pll> v;
  ll a[n],b[n];
  ll kai[100001];
  kai[0]=1;
  for(ll i=0;i<n;i++){
    cin>>a[i];
    v.push_back(make_pair(a[i],(ll)0));
  }
  for(ll i=0;i<n;i++){
    cin>>b[i];
    v.push_back(make_pair(b[i],(ll)1));
  }
  sort(v.begin(),v.end());
  for(ll i=1;i<=100000;i++){
    kai[i]=kai[i-1]*i;
    kai[i]%=mod;
  }
  ll ans=1;
  ll c[2];
  c[0]=0;c[1]=0;
  for(ll i=0;i<v.size();i++){
    ll t=v[i].second;
    ll s=(t+1)%2;
    c[t]++;
    if(c[t]>c[s]&&c[s]>0){
      ans*=nck(c[t]-1,c[s]);
      ans%=mod;
      ans*=kai[c[s]];
      ans%=mod;
      c[t]-=c[s];
      c[s]=0;
    }
   // cout<<c[0]<<" "<<c[1]<<endl;
  }
  ans*=kai[c[0]];
  ans%=mod;
  cout<<ans<<endl;
}
                