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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author kessido
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        BPath solver = new BPath();
        solver.solve(1, in, out);
        out.close();
    }

    static class BPath {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int[][] ab = in.NextIntMatrix(3, 2);
            for (int i = 1; i <= 4; i++) {
                for (int i1 = 0; i1 < 3; i1++) {
                    int iAfterI1 = traverse(i, ab[i1]);
                    if (i == iAfterI1) continue;
                    for (int i2 = 0; i2 < 3; i2++) {
                        int iAfterI2 = traverse(iAfterI1, ab[i2]);
                        if (iAfterI1 == iAfterI2 || i == iAfterI2) continue;
                        for (int i3 = 0; i3 < 3; i3++) {
                            if (i1 == i2 || i2 == i3 || i1 == i3) continue;
                            int iAfterI3 = traverse(iAfterI2, ab[i3]);
                            if (iAfterI1 == iAfterI3 || i == iAfterI3 || iAfterI2 == iAfterI3) continue;
                            out.println("YES");
                            return;
                        }
                    }
                }
            }
            out.println("NO");
        }

        private int traverse(int i, int[] ints) {
            if (i == ints[0]) return ints[1];
            if (i == ints[1]) return ints[0];
            return i;
        }

    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine(), " \t\n\r\f,");
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int NextInt() {
            return Integer.parseInt(next());
        }

        public int[][] NextIntMatrix(int n, int m) {
            return NextIntMatrix(n, m, 0);
        }

        public int[][] NextIntMatrix(int n, int m, int offset) {
            int[][] a = new int[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    a[i][j] = NextInt() + offset;
                }
            }
            return a;
        }

    }

    static class OutputWriter extends PrintWriter {
        public OutputWriter(Writer out) {
            super(out);
        }

        public OutputWriter(File file) throws FileNotFoundException {
            super(file);
        }

        public OutputWriter(OutputStream out) {
            super(out);
        }

    }
}

