def u(v): a, b, c, d, e, f = v return not(not(not(not(not(a and b) and c) and d) and e) and f) l = list(map(int, input().split())) for i in range(1 << 6): v = [0] * 6 for j in range(6): if i >> j & 1: v[j] = 1 f = 1 for j in range(6): for k in range(6): if l[j] == l[k] and v[j] != v[k]: f = 0 if f: if u(v): print("YES") exit() print("NO")