#include using namespace std; typedef long long ll; typedef pair pii; #define fi first #define se second #define mp make_pair #define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); const int N = 1050; vector T[N]; bool vis[N]; int col[N]; int c0,c1; bool shit; void dfs(int u, int pa){ vis[u]=true; if(col[u]==0)c0++; else c1 ++ ; for(auto x : T[u]){ if(!vis[x]){ col[x]=col[u]^1; dfs(x,u); } else if(col[x] == col[u]){ shit=true; } } } int main(){ fastIO; int n; cin >> n; vector x(n), y(n), r(n); for(int i = 0 ; i < n; i ++ ){ cin >> x[i] >> y[i] >> r[i]; } for(int i = 0 ; i < n; i ++ ){ for(int j = i + 1; j < n; j ++ ){ if((x[i]-x[j]) * 1ll *(x[i]-x[j]) + (y[i]-y[j]) * 1ll * (y[i]-y[j]) == (r[i] + r[j]) * 1ll * (r[i] + r[j])){ T[i].push_back(j); T[j].push_back(i); } } } for(int i = 0 ; i < n; i ++ ){ if(!vis[i]){ c0=c1=0; shit=false; dfs(i,-1); if(c0!=c1 && !shit){ cout << "YES\n"; return 0; } } } cout << "NO\n"; return 0; }