In a small but very proud high school it was decided to win ACM ICPC. This goal requires to compose as many teams of three as possible, but since there were only 6 students who wished to participate, the decision was to build exactly two teams.

After practice competition, participant number i got a score of ai. Team score is defined as sum of scores of its participants. High school management is interested if it's possible to build two teams with equal scores. Your task is to answer that question.

Input

The single line contains six integers a1, ..., a6 (0 ≤ ai ≤ 1000) — scores of the participants

Output

Print "YES" (quotes for clarity), if it is possible to build teams with equal score, and "NO" otherwise.

You can print each character either upper- or lowercase ("YeS" and "yes" are valid when the answer is "YES").

Examples

Input

1 3 2 1 2 1


Output

YES


Input

1 1 1 1 1 99


Output

NO

Note

In the first sample, first team can be composed of 1st, 2nd and 6th participant, second — of 3rd, 4th and 5th: team scores are 1 + 3 + 1 = 2 + 1 + 2 = 5.

In the second sample, score of participant number 6 is too high: his team score will be definitely greater.

	import java.io.*;
	import java.util.*;
	public class Solution {
			static int MAX = (int)1e5+1;
			static int ans = Integer.MAX_VALUE;
			static boolean vis[][];
			static ArrayList<String> list = new ArrayList<>();
			public static void main(String[] args)throws Exception{
				//InputReader input = new InputReader(System.in);
				Scanner input = new Scanner(System.in);
				OutputStreamWriter out = new OutputStreamWriter(System.out);
				int n = 6;
				int sum =0;
				int arr[] = new int[n];
				for(int i =0;i<n;i++) {
					arr[i] = input.nextInt();
					sum+=arr[i];
				}
				if(sum%2 == 1)System.out.println("NO");
				else {
					int target = sum/2;
					boolean ok1 = check(arr,target);
					boolean ok2 = check(arr,target);
					if(ok1 && ok2)System.out.println("YES");
					else System.out.println("NO");
				}
			}
			public static boolean check(int arr[],int target) {
				int n = arr.length;
				for(int i =0;i<n;i++) {
					if(arr[i] == -1)continue;
					for(int j =0;j<n;j++) {
						if(arr[j] == -1)continue;
						for(int z =0;z<n;z++) {
							if(arr[z] == -1)continue;
							if(i != j && j != z && z != i) {
								if(arr[i] + arr[j] + arr[z] == target ) {
									arr[i] = -1;
									arr[j] = -1;
									arr[z] = -1;
									return true;
								}
							}
						}
					}
				}
				return false;
			}
			
			public static int gcd(int arr[]) {
				int gcd = 0;
				for(int i =0;i<arr.length;i++) {
					gcd = gcd(arr[i],gcd);
				}
				return gcd;
			}
			


			public static boolean check(int arr[]) {
				for(int i =0;i<arr.length-1;i++) {
					if(arr[i] != arr[i+1])return false;
				}
				return true;
			}
			public static int sum(int n) {
				int sum =0;
				while(n>0) {
					sum+=(n%10);
					n/=10;
				}
				return sum;
			}
			public static boolean lucky(int n) {
				HashSet<Integer>set = new HashSet<>();
				while(n>0) {
					set.add(n%10);
					n/=10;
				}
				if(set.contains(4) && set.contains(7) && set.size() ==2)return true;
				return false;
			}
				
			/*
			 3 10 3 5 12
	1 1 1 1
	1 1 1 2
	1 1 1 3
	1 1 1 4
	1 1 1 5
	1 1 1 6
	1 1 1 7
	1 1 1 8
	1 1 1 9
	1 1 1 10
	1 1 2 2
	1 1 2 1
			 */
			
		
			public static void construct(int a,int b,int arr[][]) {
				arr[a][b] = -1;
				int x = a,y=b;
				while(x>=0)arr[x--][b] = -1;
				x= a;
				while(x<arr.length)arr[x++][b] = -1;
				y =b;
				while(y<arr[0].length)arr[a][y++] = -1;
				y = b;
				while(y>=0)arr[a][y--] = -1;
				x = a;y=b;
				while(x>=0 && y>=0)arr[x--][y--] = -1;
				x = a;y=b;
				while(x>=0 && y<arr[0].length)arr[x--][y++] = -1;
				x=a;y=b;
				while(x<arr.length && y<arr[0].length)arr[x++][y++] = -1;
				x=a;y=b;
				while(x<arr.length && y>=0)arr[x++][y--] = -1;
			}
			public static int gcd(int a,int b) {
				return b==0? a:gcd(b,a%b);
			}
			public static boolean isPalindrome(int hh,int mm) {
				String s= "";
				if(hh<10)s+="0";
				s+=hh;
				if(mm<10)s+="0";
				s+=mm;
				int l =0;
				int r = s.length()-1;
				while(l<r){
					if(s.charAt(l)!= s.charAt(r))return false;
					l++;
					r--;
				}
				return true;
			}
			
			public static void sort(int arr[]) {
				ArrayList<Integer>list = new ArrayList<>();
				for(int it:arr)list.add(it);
				Collections.sort(list);
				for(int i =0;i<arr.length;i++)arr[i] = list.get(i);
			}
			public static void swap(int a,int b,int arr[]){
				int t = arr[a];
				arr[a]= arr[b];
				arr[b] = t;
			}
			
	}
	class Pair{
		int x,y;
		public Pair(int x,int y) {
			this.x = x;
			this.y = y;
		}
	}
	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 int readInt() {
			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 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 double readDouble() {
			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, readInt());
				}
				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, readInt());
					}
					if (c < '0' || c > '9') {
						throw new InputMismatchException();
					}
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}
		
		public long readLong() {
			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 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);
		}
	}
