CF870E Points, Lines and Ready-made Titles

Description

You are given $ n $ distinct points on a plane with integral coordinates. For each point you can either draw a vertical line through it, draw a horizontal line through it, or do nothing. You consider several coinciding straight lines as a single one. How many distinct pictures you can get? Print the answer modulo $ 10^{9}+7 $ .

Input Format

N/A

Output Format

N/A

Explanation/Hint

In the first example there are two vertical and two horizontal lines passing through the points. You can get pictures with any subset of these lines. For example, you can get the picture containing all four lines in two ways (each segment represents a line containing it). The first way: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF870E/16d9107c00bae4cf5f33754cdc1989ed71bbf8ba.png) The second way: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF870E/cc0bfe7f0aace68a3f05623608cb42281913494e.png)In the second example you can work with two points independently. The number of pictures is $ 3^{2}=9 $ .