#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  vector<long long> a(6);
  for (long long i = 0; i < 6; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  do {
    long long k1, k2;
    k1 = a[0] + a[1] + a[2];
    k2 = a[3] + a[4] + a[5];
    if (k1 == k2) {
      cout << "YES";
      return 0;
    }
  } while (next_permutation(a.begin(), a.end()));
  cout << "NO";
  return 0;
}
