You are given two simple undirected graphs $$$G_1$$$ and $$$G_2$$$ on the same set of labeled vertices $$$1, 2, \dots, n$$$.
In one operation, you choose exactly $$$k$$$ vertices. Then, for every pair of chosen vertices:
In other words, you toggle every edge inside the chosen set of $$$k$$$ vertices.
Determine whether it is possible to transform $$$G_1$$$ into $$$G_2$$$ after some number of operations.
The first line contains two integers $$$n$$$ and $$$k$$$ ($$$2 \le k \le n \le 200000$$$).
The second line contains one integer $$$m_1$$$ ($$$0 \le m_1 \le \min(300000, \frac{n(n-1)}{2})$$$), the number of edges of $$$G_1$$$.
Each of the next $$$m_1$$$ lines contains two integers $$$u$$$ and $$$v$$$ ($$$1 \le u, v \le n$$$, $$$u \ne v$$$), describing one edge of $$$G_1$$$.
The next line contains one integer $$$m_2$$$ ($$$0 \le m_2 \le \min(300000, \frac{n(n-1)}{2})$$$), the number of edges of $$$G_2$$$.
Each of the next $$$m_2$$$ lines contains two integers $$$u$$$ and $$$v$$$ ($$$1 \le u, v \le n$$$, $$$u \ne v$$$), describing one edge of $$$G_2$$$.
It is guaranteed that both graphs are simple.
Print YES if it is possible to transform $$$G_1$$$ into $$$G_2$$$, and NO otherwise.
5 4041 22 33 44 5
NO
6 5081 31 41 51 62 32 42 52 6
YES
| Name |
|---|


