#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e, f;
  cin >> a >> b >> c >> d >> e >> f;
  if ((a + b + c == d + e + f) || (a + b + d == c + e + f) ||
      (a + b + e == d + c + f) || (a + b + f == d + e + c) ||
      (a + d + c == b + e + f) || (a + e + c == d + b + f) ||
      (a + f + c == d + e + b) || (a + d + e == b + c + f) ||
      (e + b + c == d + a + f) || (d + b + c == a + e + f))
    cout << "YES\n";
  else {
    cout << "NO\n";
  }
}
