This page is still under construction.

Parts of this page are still being built. What you see may change.

Expressways

Time limit1sMemory limit128 MB

Summary
Decide whether some subset of the given roads touches every city an odd number of times.
Level

Medium7 of 10

Topics
Graph, Math, DFS
Solved
No attempts yet

Problem

Byteland has nn cities and mm roads connecting them. The roads are in poor shape, and because of a lack of funds they have not been repaired for a long time.

The residents are demanding that some of the roads be turned into brand-new expressways. The king agrees to build them, but under one condition: there has to be a construction plan in which every one of the nn cities is served by an odd number of expressways. An expressway can only be built on top of a road that already exists.

Deciding which roads become expressways is the same as choosing a subset of the existing roads. For a given road network, decide whether a plan exists in which every city is incident to an odd number of the chosen roads.

Input

The first line contains a single integer zz (1≤z≤1001 \le z \le 100), the number of test sets. The test sets follow.

The first line of a test set contains two integers nn and mm (1≤n≤1000001 \le n \le 100000, 1≤m≤2000001 \le m \le 200000), the number of cities and the number of roads. Each of the next mm lines contains two integers xx and yy (1≤x,y≤n1 \le x, y \le n), meaning that cities xx and yy are joined by a road. The same pair of cities may be joined by more than one road, and a road may connect a city with itself.

The sum of nn over all test sets does not exceed 10000001000000, and the sum of mm does not exceed 20000002000000.

Output

For each test set, print a single line.

Print YES if it is possible to choose a subset of the roads so that every city is incident to an odd number of the chosen roads, and print NO otherwise.

Examples2

  1. Example 1

    Input
    1
    6 5
    1 2
    1 3
    2 3
    3 4
    5 6
    
    Expected output
    YES
    
  2. Example 2

    Input
    3
    2 1
    1 2
    3 2
    1 2
    2 3
    4 2
    1 2
    3 4
    
    Expected output
    YES
    NO
    YES