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.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Map.Entry;

import java.util.PriorityQueue;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Main {

	public static boolean route(int pos, boolean[] used, int[][] edges, boolean[] visited) {
		visited[pos] = true;
		boolean ok = true;
		for(final boolean b :visited) { ok &= b; }
		if(ok) { return ok; }
		
		//System.out.println(pos);
		
		for(int i = 0; i < edges.length; i++) {
			if(used[i]) { continue; }
			
			final int from = edges[i][0];
			final int to = edges[i][1];
			//System.out.println(from + " " + to);
			
			if(pos == from && !visited[to]) {
				used[i] = true;
				if(route(to, used, edges, visited)) { return true; }
				used[i] = false;
			}
			if(pos == to && !visited[from]) {
				used[i] = true;
				if(route(from, used, edges, visited)) { return true; }
				used[i] = false;
			}
		}
		
		visited[pos] = false;
		return false;
	}
	
	public static void main(String[] args) throws IOException {
		try(final Scanner sc = new Scanner(System.in)){
			int[][] edges = new int[3][2];
			for(int i = 0; i < 3; i++) {
				edges[i] = new int[2];
				edges[i][0] = sc.nextInt() - 1;
				edges[i][1] = sc.nextInt() - 1;
			}
			
			final int N = 4;
			for(int from = 0; from < N; from++) {
				if(route(from, new boolean[edges.length], edges, new boolean[N])) {
					System.out.println("YES");
					return;
				}
			}
			
			System.out.println("NO");
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}