a = list(map(int, input().split())) print("NO" if a[0] == a[1] == a[2] and a[3] == a[4] == a[5] else "YES")