package yukicoder; import java.util.Arrays; import java.util.Scanner; public class Main{ public static void main(String[] args)throws Exception{ new Main().solve(); } void solve(){ Scanner sc=new Scanner(System.in); int[] d=new int[7]; for(int i=0;i<7;i++){ d[i]=sc.nextInt(); } Arrays.sort(d); int count=1; int countM=1; int countc=0; for(int i=0;i<6;i++){ if(d[i]==d[i+1]){ count++; countM=Math.max(countM, count); }else{ if(count>0)countc++; count=0; } } if(count>0)countc++; if(countc>=3){ System.out.println("NO"); return; } if(countc==2){ if((d[0]==d[1]&&d[2]==d[3])||(d[5]==d[6]&&d[3]==d[4])){ System.out.println("NO"); return; } } if(countM>=3){ if(countM==3){ if(d[2]==d[3]&&d[3]==d[4]){ if((d[1]!=d[0])||(d[5]!=d[6])){ System.out.println("YES"); return; } } } System.out.println("NO"); } } }