import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String[] s = new String[n]; String[] t = new String[n]; for (int i = 0; i < n; i++) { s[i] = sc.next(); t[i] = sc.next(); } sc.close(); for (int i = 0; i < n; i++) { boolean flg1 = true; boolean flg2 = true; for (int j = 0; j < n; j++) { if (i != j) { if (s[i].equals(s[j]) || s[i].equals(t[j])) { flg1 = false; } if (t[i].equals(s[j]) || t[i].equals(t[j])) { flg2 = false; } } } if (!flg1 && !flg2) { System.out.println("No"); return; } } System.out.println("Yes"); } }