import java.util.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter ou = new PrintWriter(System.out); int[][] a = new int[2][3]; for(int i = 0 ; i < 2 ; i++){ for(int j = 0 ; j < 3 ; j++){ a[i][j] = Integer.parseInt(sc.next()); } Arrays.sort(a[i]); } boolean q = true; for(int i = 0 ; i < 3 && q ; i++){ if(a[0][i] != a[1][i]) q = false; } if(q) ou.println("Yes"); else ou.println("No"); ou.flush(); sc.close(); } }