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.util.*;
import java.io.*;
import static java.lang.Math.*;

/* spar5h */

public class Main implements Runnable{    
	
	static boolean nextPermutation(int[] a) {
		
		int p = -1;
		
		for(int i = a.length - 2; i >= 0; i--) {
			
			if(a[i] < a[i + 1]) {
				p = i; break;
			}
		}	
		
		if(p == -1)
			return false;
		
		int q = -1;
		
		for(int i = a.length - 1; i > p; i--) {
			
			if(a[i] > a[p]) {
				q = i; break;
			}
		}
		
		int temp = a[p]; a[p] = a[q]; a[q] = temp;
		
		for(int i = 0; i < (a.length - (p + 1)) / 2; i++) {
			temp = a[p + 1 + i]; a[p + 1 + i] = a[a.length - i - 1]; a[a.length - i - 1] = temp; 
		}
		
		return true;
	}
	
	public void run() {
		
		InputReader s = new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);
		
		int[][] m = new int[4][4];
		
		for(int i = 0; i < 3; i++) {
			int u = s.nextInt() - 1, v = s.nextInt() - 1;
			m[u][v] = 1; m[v][u] = 1;
		}
		
		int[] a = new int[4];
		
		for(int i = 0; i < 4; i++)
			a[i] = i;
		
		boolean check = false;
		
		while(true) {
			
			check = true;
			
			for(int i = 0; i < 3; i++)
				if(m[a[i]][a[i + 1]] == 0)
					check = false;
			
			if(check)
				break;
			
			if(!nextPermutation(a))
				break;
		}
		
		if(check)
			w.println("YES");
		else
			w.println("NO");
		
		w.close();
	}
	
	static class InputReader {
		
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		
		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}
		
		public int read()
		{
			if (numChars==-1) 
				throw new InputMismatchException();
			
			if (curChar >= numChars)
			{
				curChar = 0;
				try 
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}
				
				if(numChars <= 0)				
					return -1;
			}
			return buf[curChar++];
		}
	 
		public String nextLine()
		{
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		public int nextInt()
		{
			int c = read();
			
			while(isSpaceChar(c)) 
				c = read();
			
			int sgn = 1;
			
			if (c == '-') 
			{
				sgn = -1;
				c = read();
			}
			
			int res = 0;
			do 
			{
				if(c<'0'||c>'9') 
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c)); 
			
			return res * sgn;
		}
		
		public long nextLong() 
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') 
			{
				sgn = -1;
				c = read();
			}
			long res = 0;
			
			do 
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));
				return res * sgn;
		}
		
		public double nextDouble() 
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') 
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.') 
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.') 
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c)) 
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}
		
		public String readString() 
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do 
			{
				res.appendCodePoint(c);
				c = read();
			} 
			while (!isSpaceChar(c));
			
			return res.toString();
		}
	 
		public boolean isSpaceChar(int c) 
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	 
		public String next() 
		{
			return readString();
		}
		
		public interface SpaceCharFilter 
		{
			public boolean isSpaceChar(int ch);
		}
	}
    
	public static void main(String args[]) throws Exception
	{
		new Thread(null, new Main(),"Main",1<<26).start();
	}
}