a = map(int, raw_input().split())
t = sum(a)
if t % 2 == 1:
    print "NO"
else:
    p = False
    for j in range(len(a)):
        for i in range(j + 1, len(a)):
            for k in range(i + 1, len(a)):
                if (a[j] + a[k] + a[i]) * 2 == t:
                    p = True

    if p:
        print "YES"
    else:
        print "NO"
#test
#test
#test
#test
#test
#test
#test
#test
#test
#test
#test
#test
#test
#test
#test
#test
#test
#test
#test
#test
#test
