There is a two-dimensional plane.
You have a set of points that satisfies (Both and are integers), and there are no two points with the same coordinates.
If two points have the same horizontal or vertical coordinates, we will connect an edge between these two points. This forms a graph.
You need to find the sum of the maximum number of matches in the graphs formed by all possible non empty sets, and output the result modulo .
Here, the maximum number of matches in a graph is defined as: selecting the most edges so that there are no common vertices between any two edges.