{"problem":{"name":"Mr.Aoki Incubator","description":{"content":"Takahashi is an expert of Clone Jutsu, a secret art that creates copies of his body. On a number line, there are $N$ copies of Takahashi, numbered $1$ through $N$. The $i$\\-th copy is located at posit","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc015_e"},"statements":[{"statement_type":"Markdown","content":"Takahashi is an expert of Clone Jutsu, a secret art that creates copies of his body.\nOn a number line, there are $N$ copies of Takahashi, numbered $1$ through $N$. The $i$\\-th copy is located at position $X_i$ and starts walking with velocity $V_i$ in the positive direction at time $0$.\nKenus is a master of Transformation Jutsu, and not only can he change into a person other than himself, but he can also transform another person into someone else.\nKenus can select some of the copies of Takahashi at time $0$, and transform them into copies of Aoki, another Ninja. The walking velocity of a copy does not change when it transforms. From then on, whenever a copy of Takahashi and a copy of Aoki are at the same coordinate, that copy of Takahashi transforms into a copy of Aoki.\nAmong the $2^N$ ways to transform some copies of Takahashi into copies of Aoki at time $0$, in how many ways will all the copies of Takahashi become copies of Aoki after a sufficiently long time? Find the count modulo $10^9+7$.\n\n## Constraints\n\n*   $1 ≤ N ≤ 200000$\n*   $1 ≤ X_i,V_i ≤ 10^9(1 ≤ i ≤ N)$\n*   $X_i$ and $V_i$ are integers.\n*   All $X_i$ are distinct.\n*   All $V_i$ are distinct.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$X_1$ $V_1$\n:\n$X_N$ $V_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc015_e","tags":[],"sample_group":[["3\n2 5\n6 1\n3 7","6\n\nAll copies of Takahashi will turn into copies of Aoki after a sufficiently long time if Kenus transforms one of the following sets of copies of Takahashi into copies of Aoki: $(2)$, $(3)$, $(1,2)$, $(1,3)$, $(2,3)$ and $(1,2,3)$."],["4\n3 7\n2 9\n8 16\n10 8","9"]],"created_at":"2026-03-03 11:01:14"}}