#include <bits/stdc++.h>
using namespace std;
int x[10000];
long long s1 = 0, s2 = 0;
int k = 0;
int main() {
  ios_base::sync_with_stdio(0);
  for (int i = 0; i < 6; i++) cin >> x[i];
  for (int mask = 0; mask < (1 << 6); mask++) {
    s1 = 0;
    s2 = 0;
    k = 0;
    for (int y = 0; y < 6; y++)
      if ((mask & (1 << y))) {
        k++;
        s1 += x[y];
      } else
        s2 += x[y];
    if (s1 == s2) {
      if (k == 3) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
}
