ok = True
prev = int(input())
cur = prev
while True:
cur = int(input())
if cur == 0:
break
if (cur > 0 and prev > 0) or (cur < 0 and prev < 0):
ok = False
prev = cur
if ok:
print("YES")
else:
print("NO")
ok = True
prev = int(input())
cur = prev
while True:
cur = int(input())
if cur == 0:
break
if (cur > 0 and prev > 0) or (cur < 0 and prev < 0):
ok = False
prev = cur
if ok:
print("YES")
else:
print("NO")