#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)
    cout << "YES" << endl;
  else if (a + b + d == c + e + f)
    cout << "YES" << endl;
  else if (a + b + e == c + d + f)
    cout << "YES" << endl;
  else if (a + b + f == c + d + e)
    cout << "YES" << endl;
  else if (a + c + d == b + e + f)
    cout << "YES" << endl;
  else if (a + c + e == b + d + f)
    cout << "YES" << endl;
  else if (a + c + f == b + d + e)
    cout << "YES" << endl;
  else if (a + d + e == b + c + f)
    cout << "YES" << endl;
  else if (a + d + f == b + c + e)
    cout << "YES" << endl;
  else if (a + e + f == b + c + d)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
