There are four towns, numbered 1,2,3 and 4. Also, there are three roads. The i-th road connects different towns a_i and b_i bidirectionally. No two roads connect the same pair of towns. Other than these roads, there is no way to travel between these towns, but any town can be reached from any other town using these roads.

Determine if we can visit all the towns by traversing each of the roads exactly once.

Constraints

* 1 \leq a_i,b_i \leq 4(1\leq i\leq 3)
* a_i and b_i are different. (1\leq i\leq 3)
* No two roads connect the same pair of towns.
* Any town can be reached from any other town using the roads.

Input

Input is given from Standard Input in the following format:


a_1 b_1
a_2 b_2
a_3 b_3


Output

If we can visit all the towns by traversing each of the roads exactly once, print `YES`; otherwise, print `NO`.

Examples

Input

4 2
1 3
2 3


Output

YES


Input

3 2
2 4
1 2


Output

NO


Input

2 1
3 2
4 3


Output

YES
import java.io.*;
import java.util.*;

import javax.net.ssl.SSLContext;

public class Main {
	
	final boolean isDebug = false;
	String fileName = "input.txt";
	FastScanner sc;
	//PrintWriter out;
	final int MOD = 1000000007;
	final int INF = Integer.MAX_VALUE / 2;
	
	/* solve */
	void solve(){
		int[][] edge = new int[3][2];
		for(int i = 0; i < 3; i++){
			edge[i][0] = sc.nextInt()-1;
			edge[i][1] = sc.nextInt()-1;
		}
		
		int now = -1;
		for(int start = 0; start < 4; start++){
			now = start;
			boolean[] visited = new boolean[3];
			boolean isOk = true;
			
			for(int j = 0; j < 3; j++){
				boolean isLoop = true;
				for(int k = 0; k < 3 && isLoop; k++){
					
					if(edge[k][0] == now && !visited[k]){
						now = edge[k][1];
						visited[k] = true;
						isLoop = false;
					}else if(edge[k][1] == now && !visited[k]){
						now = edge[k][0];
						visited[k] = true;
						isLoop = false;
					}
				}
				
				if(isLoop == true) isOk = false;
			}
			
			if(isOk){
				System.out.println("YES");
				return;
			}
		}
		
		System.out.println("NO");
	}
	
	/* end solve */
	
	/* main */
	public static void main(String[] args) throws IOException {
		new Main().m();
	}
	
	void m() throws IOException {
		long S = System.currentTimeMillis();
		sc = (isDebug) ? new FastScanner(new FileInputStream(fileName)) : new FastScanner(System.in);
		//out = new PrintWriter(System.out);
		solve();
		//out.flush();
		long G = System.currentTimeMillis();
		if(isDebug){
			System.out.println("---Debug---");
			System.out.printf("%8d ms", (G-S));
		}
	}
	/* end main */
}
/* end Main */

class FastScanner {
    private InputStream in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    public FastScanner(InputStream in) {
		this.in = in;
	}
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() {
    	if (hasNextByte()) return buffer[ptr++];
    	else return -1;
    }
    private static boolean isPrintableChar(int c){
    	return 33 <= c && c <= 126;
    }
    public boolean hasNext() {
    	while(hasNextByte() && !isPrintableChar(buffer[ptr]))
    		ptr++; return hasNextByte();
    }
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() {
    	return Double.parseDouble(next());
    }
}
