#include<iostream>
#include<vector>
#include<string>
#include<type_traits>
#include<sstream>
#include<tuple>
#include<bitset>
#include<regex>
#include<set>
#include<queue>
#include<map>
using namespace std;
int main(){
int n;
while (cin >> n){
if (n == 0) break;
map<pair<int, int>, int> amount;
for (int i = 0; i < n; i++){
pair<int, int> temp;
cin >> temp.first >> temp.second;
amount[temp]++;
}
bool flag = true;
for (auto it : amount){
pair<int, int> temp;
temp.second = it.first.first;
temp.first = it.first.second;
if (amount[temp] != it.second){
flag = false;
cout << "NO" << endl;
break;
}
}
if (flag) cout << "YES" << endl;
}
//system("pause");
return 0;
}
10763 - Foreign Exchange
最新推荐文章于 2018-07-31 16:03:20 发布