#include <bits/stdc++.h>
using namespace std;
int isSquare(long n);
int main(int argc, const char* argv[]) {
  string str;
  int n, m, sum = 0;
  long long max = INT64_MIN;
  long long min = INT64_MAX;
  int c = 0, x, f = 0;
  ;
  vector<int> stairs;
  map<int, int> map;
  long double arr[6];
  for (int i = 0; i < 6; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 6; j++) {
      for (int k = 0; k < 6; k++) {
        if (i != k && j != k && i != j) {
          if ((sum - arr[i] - arr[j] - arr[k]) == arr[i] + arr[j] + arr[k]) {
            cout << "YES " << endl;
            return 0;
          }
        }
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
