#abc272b. [abc272_b]Everyone is Friends
[abc272_b]Everyone is Friends
Problem Statement
There are people numbered .
parties were held. people attended the -th party, and they were People .
Determine if every two people attended the same party at least once.
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print Yes
if every two people attended the same party at least once; print No
otherwise.
Sample Input 1
3 3
2 1 2
2 2 3
2 1 3
Sample Output 1
Yes
Both Person and Person attended the -st party.
Both Person and Person attended the -nd party.
Both Person and Person attended the -rd party.
Therefore, every two people attended the same party at least once, so the answer is Yes
.
Sample Input 2
4 2
3 1 2 4
3 2 3 4
Sample Output 2
No
Person and Person did not attend the same party, so the answer is No
.