You are given n intervals and their starts are all unique and also their ends are all unique. No two intervals may include each other (means there are no two different intervals [l,r] and [L,R] which l≤L<R≤r).
Count the number of subsets of intervals in which their union is as same as all n intervals union modulo 109+7.
Formally, consider the interval's set A and count the number B⊆A which ∪i∈Ai=∪i∈Bi modulo 109+7.
The union of two intervals [l,r] and [L,R] displayed as [l,r]∪[L,R] is {x∈R | l≤x≤r or L≤x≤R}.
Input format
1≤n≤3×105
1≤li<ri≤109
It is guaranteed all lis are unique and also all ris are unique. No two intervals may include each other.
Output format
The output contains an integer denoting the number of subsets with provided conditions modulo 109+7.
All intervals else third interval must be in the subset, the third interval can be or not be in the subset, so the answer is 2.