#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int arr[6];
  for (int i = 0; i < 6; i++) {
    cin >> arr[i];
  }
  for (int i = 1; i < (1 << 6); i++) {
    int s = 0, rest = 0;
    int cnt = 0;
    for (int j = 0; j < 6; j++) {
      if (i & (1 << j)) {
        s += arr[j];
        cnt++;
      } else {
        rest += arr[j];
      }
    }
    if (rest == s && cnt == 3) {
      cout << "YES\n";
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
