Have you ever tried to explain to the coordinator, why it is eight hours to the contest and not a single problem has been prepared yet? Misha had. And this time he has a really strong excuse: he faced a space-time paradox! Space and time replaced each other.

The entire universe turned into an enormous clock face with three hands — hour, minute, and second. Time froze, and clocks now show the time h hours, m minutes, s seconds.

Last time Misha talked with the coordinator at t_1 o'clock, so now he stands on the number t_1 on the clock face. The contest should be ready by t_2 o'clock. In the terms of paradox it means that Misha has to go to number t_2 somehow. Note that he doesn't have to move forward only: in these circumstances time has no direction.

Clock hands are very long, and Misha cannot get round them. He also cannot step over as it leads to the collapse of space-time. That is, if hour clock points 12 and Misha stands at 11 then he cannot move to 1 along the top arc. He has to follow all the way round the clock center (of course, if there are no other hands on his way).

Given the hands' positions, t_1, and t_2, find if Misha can prepare the contest on time (or should we say on space?). That is, find if he can move from t_1 to t_2 by the clock face.


-----Input-----

Five integers h, m, s, t_1, t_2 (1 ≤ h ≤ 12, 0 ≤ m, s ≤ 59, 1 ≤ t_1, t_2 ≤ 12, t_1 ≠ t_2).

Misha's position and the target time do not coincide with the position of any hand.


-----Output-----

Print "YES" (quotes for clarity), if Misha can prepare the contest on time, and "NO" otherwise.

You can print each character either upper- or lowercase ("YeS" and "yes" are valid when the answer is "YES").


-----Examples-----
Input
12 30 45 3 11

Output
NO

Input
12 0 1 12 1

Output
YES

Input
3 47 0 4 9

Output
YES



-----Note-----

The three examples are shown on the pictures below from left to right. The starting position of Misha is shown with green, the ending position is shown with pink. Note that the positions of the hands on the pictures are not exact, but are close to the exact and the answer is the same. $\oplus 0 \theta$

Difficulty: MEDIUM

Solutions:
(a, b, c, s, t) = map(int, input().split())
if a == 12:
	a = 0
if s == 12:
	s = 0
if t == 12:
	t = 0
a += b / 120 + c / 120
b += c / 60
b /= 5
c /= 5
f = [a, b, c]
f.sort()
if f[0] < s and s < f[1]:
	x = 1
elif f[1] < s and s < f[2]:
	x = 2
else:
	x = 3
if f[0] < t and t < f[1]:
	y = 1
elif f[1] < t and t < f[2]:
	y = 2
else:
	y = 3
if x == y:
	print('YES')
else:
	print('NO')


(h, m, s, t1, t2) = list(map(int, input().split()))
h = h % 12
t1 = t1 % 12
t2 = t2 % 12
t1 = t1 * 60 * 60
t2 = t2 * 60 * 60
(t1, t2) = (min(t1, t2), max(t1, t2))
hourHand = h * 60 * 60 + m * 60 + s
minHand = (m * 60 + s) * 12
secondHand = s * 60 * 12
count = 0
for val in [hourHand, minHand, secondHand]:
	if val >= t1 and val <= t2:
		count += 1
if count == 0 or count == 3:
	print('YES')
else:
	print('NO')


(h, m, s, t1, t2) = list(map(int, input().split()))
m += s / 60
h += m / 60
m /= 5
s /= 5
h = h % 12
m = m % 12
s = s % 12
T1 = min(t1, t2)
T2 = max(t1, t2)
if T1 < h < T2 and T1 < m < T2 and (T1 < s < T2):
	print('YES')
elif not (T1 < h < T2 or T1 < m < T2 or T1 < s < T2):
	print('YES')
else:
	print('NO')


(h, m, s, t1, t2) = map(int, input().split())
h = (h + m / 60 + s / 3600) % 12
m = (m + s / 60) % 60
h *= 5
t1 *= 5
t2 *= 5
things = sorted([h, m, s])
for i in range(3):
	if things[i] > t1:
		break
if things[2] < t1:
	i = 0
for j in range(3):
	if things[j] > t2:
		break
if things[2] < t2:
	j = 0
if i == j:
	print('YES')
else:
	print('NO')


used = [0] * 121
(h, m, s, t1, t2) = map(int, input().split())
h %= 12
t1 %= 12
t2 %= 12
t1 *= 5
t2 *= 5
used[h * 5] = 1
used[h * 5 + 60] = 1
used[m] = 1
used[m + 60] = 1
used[s] = 1
used[s + 60] = 1
if t1 > t2:
	(t1, t2) = (t2, t1)
t3 = t1 + 60
if sum(used[t1:t2]) == 0 or sum(used[t2:t3]) == 0:
	print('YES')
else:
	print('NO')


(h, m, s, t1, t2) = map(int, input().split())
ls = s * 2
lm = m * 2
if ls != 0:
	lm += 1
lh = h % 12 * 10
if ls != 0 or lm != 0:
	lh += 1
t1 = t1 % 12 * 10
t2 = t2 % 12 * 10
(t1, t2) = (min(t1, t2), max(t1, t2))
ans = False
ans1 = True
ans2 = True
if t1 <= ls <= t2 or t1 <= lm <= t2 or t1 <= lh <= t2:
	ans1 = False
if 0 <= ls <= t1 or 0 <= lm <= t1 or 0 <= lh <= t1:
	ans2 = False
if t2 <= ls <= 118 or t2 <= lm <= 118 or t2 <= lh <= 118:
	ans2 = False
if ans1 or ans2:
	ans = True
if ans:
	print('YES')
else:
	print('NO')


(h, m, s, t1, t2) = map(int, input().split())
h += m / 60 + s / 3600
h %= 12
m += s / 60
m %= 60
m /= 5
s /= 5
(t1, t2) = (min(t1, t2), max(t1, t2))
mark = 1
if t1 < h < t2:
	if t1 < m < t2 and t1 < s < t2:
		print('YES')
		mark = 0
elif (m < t1 or m > t2) and (s < t1 or s > t2):
	print('YES')
	mark = 0
if mark:
	print('NO')


def isBet(a, b, c):
	if c > a and c < b:
		return True
	return False
lst = input().split()
h = float(int(lst[0]))
m = float(lst[1]) / 5
s = float(lst[2]) / 5
a = int(lst[3])
b = int(lst[4])
if a > b:
	(a, b) = (b, a)
m += s / 720
h += m / 12
count = 0
if isBet(a, b, h):
	count += 1
if isBet(a, b, m):
	count += 1
if isBet(a, b, s):
	count += 1
if count == 0 or count == 3:
	print('YES')
else:
	print('NO')


a = list(map(int, input().split()))
if a[0] == 12 and (a[1] != 0 or a[2] != 0):
	a[0] = 0
if a[3] == 12:
	a[3] = 0
if a[4] == 12:
	a[4] = 0
t1 = min(a[3], a[4])
t2 = max(a[3], a[4])
a[0] += a[1] / 60 + a[2] / 3600
a[1] = a[1] / 5 + a[2] / 600
a[2] /= 5
a.sort()
ch = 0
if a[0] == t1 and a[4] == t2:
	ch = 1
for i in range(1, 5):
	if a[i] == t2 and a[i - 1] == t1:
		ch = 1
if ch == 1:
	print('YES')
else:
	print('NO')


(h, m, s, t1, t2) = map(int, input().split())
m = m / 5
s = s / 5
co = 0
a = min(t1, t2)
b = t1 + t2
t1 = a
t2 = b - a
if t1 <= h and h < t2:
	co += 1
if t1 <= m and m < t2:
	co += 1
if t1 <= s and s < t2:
	co += 1
if co == 0 or co == 3:
	print('YES')
else:
	print('NO')


a = input().split()
times = [int(n) for n in a]
numbers = [(times[0] * 30 + times[1] / 2 + times[2] / 120) % 360, (times[1] * 6 + times[2] / 10) % 360, times[2] * 6 % 360]
numbers.sort(key=float)
t1 = times[3] * 30
t2 = times[4] * 30

def reg(x):
	if numbers[0] < x < numbers[1]:
		return 1
	if numbers[1] < x < numbers[2]:
		return 2
	else:
		return 3
if reg(t1) == reg(t2):
	print('YES')
else:
	print('NO')


from math import fabs as ag
(h, m, s, a, b) = map(int, input().split(' '))
p = [0] * 12
w = [0] * 12
if h < 12:
	p[h] = 1
else:
	p[0] = 1
p[m // 5] = 1
p[s // 5] = 1
a = a % 12
b = b % 12
w[a] = 1
w[b] = 2
ch = 0
for i in range(1, 12):
	if p[(a + i - 1) % 12] == 1:
		break
	elif (a + i) % 12 == b:
		print('YES')
		ch = 1
		break
if ch == 0:
	for i in range(1, 12):
		if p[a - i] == 1:
			break
		elif w[a - i] == 2:
			print('YES')
			ch = 1
			break
if ch == 0:
	print('NO')


(h, m, s, t1, t2) = [int(i) for i in input().split(' ')]
if h == 12:
	h = 0
h = h + m / 60 + s / 3600
m = m / 5 + s / 60 / 5
s = s / 5
if t1 == 12:
	t1 = 0
if t2 == 12:
	t2 = 0
rule = sorted([h, m, s])
result = 'NO'
if rule[0] < t1 < rule[1] and rule[0] < t2 < rule[1]:
	result = 'YES'
elif rule[1] < t1 < rule[2] and rule[1] < t2 < rule[2]:
	result = 'YES'
elif (t1 < rule[0] or t1 > rule[2]) and (t2 < rule[0] or t2 > rule[2]):
	result = 'YES'
print(result)


(H, M, S, T1, T2) = map(int, input().split())
h = H % 12 * 30 + M % 60 * 0.5 + S % 60 * (1 / 120)
m = M % 60 * 6 + S % 60 * 0.1
s = S % 60 * 6
t1 = T1 % 12 * 30
t2 = T2 % 12 * 30
(h, m, s) = sorted([h, m, s])
flag = False
if h < t1 < m and h < t2 < m:
	flag = True
elif m < t1 < s and m < t2 < s:
	flag = True
elif (s < t1 <= 360 or 0 <= t1 < h) and (s < t2 <= 360 or 0 <= t2 < h):
	flag = True
if flag:
	print('YES')
else:
	print('NO')


(h, m, s, t1, t2) = input().split()
h = int(h)
m = int(m)
s = int(s)
t1 = int(t1)
t2 = int(t2)
mins = m + s / 60
hrs = h + mins / 60
tmin = min(t1, t2)
tmax = max(t1, t2)
if (tmax > hrs and hrs > tmin) and (tmax * 5 > mins and mins > tmin * 5) and (tmax * 5 > s and s > tmin * 5) or (not (tmax > hrs and hrs > tmin) and (not (tmax * 5 > mins and mins > tmin * 5)) and (not (tmax * 5 > s and s > tmin * 5))):
	print('YES')
else:
	print('NO')


(h, m, s, a, b) = list(map(int, input().split()))
mx = m + s / 60
hx = 5 * h + mx / 60
ax = 5 * a
bx = 5 * b
t = [s, mx, hx]
t.sort()
if t[0] <= ax <= t[1] and t[0] <= bx <= t[1]:
	print('YES')
elif t[1] <= ax <= t[2] and t[1] <= bx <= t[2]:
	print('YES')
elif ax <= t[0] and bx <= t[0]:
	print('YES')
elif ax >= t[2] and bx >= t[2]:
	print('YES')
elif ax >= t[2] and bx <= t[0]:
	print('YES')
elif ax <= t[0] and bx >= t[2]:
	print('YES')
else:
	print('NO')


def ok(h, m, s, t1, t2):
	if s > t1 and t2 > s:
		return 0
	elif m > t1 and t2 > m:
		return 0
	elif h > t1 and t2 > h:
		return 0
	elif s + 1 > t1 and t2 > s + 1:
		return 0
	elif m + 1 > t1 and t2 > m + 1:
		return 0
	elif h + 1 > t1 and t2 > h + 1:
		return 0
	else:
		return 1
(h, m, s, t1, t2) = map(int, input().split())
s /= 60
m = m / 60 + 1 * s / 60
m %= 1
h = h / 12 + 1 * m / 60
h %= 1
t1 /= 12
t2 /= 12
(a, b, c, d) = (t1, t2, t2, t1)
a %= 1
c %= 1
if a > b:
	b += 1
if c > d:
	d += 1
print('YES' if ok(h, m, s, a, b) or ok(h, m, s, c, d) else 'NO')


import collections
(h, m, s, t1, t2) = map(int, input().split())
positions = {}
totalSeconds = h * 360 + m * 60 + s
secondHandDegreesAt = s * 6
minuteHandDegreesAt = m * 6 + 6 / 60 * s
hourHandDegreesAt = h * 30 + (m * 60 + s) * 0.008333
if hourHandDegreesAt >= 360:
	hourHandDegreesAt -= 360
t1DegreesAt = t1 * 30
if t1DegreesAt >= 360:
	t1DegreesAt -= 360
t2DegreesAt = t2 * 30
if t2DegreesAt >= 360:
	t2DegreesAt -= 360
positions[secondHandDegreesAt] = 's'
positions[minuteHandDegreesAt] = 'm'
positions[hourHandDegreesAt] = 'h'
positions[t1DegreesAt] = 't1'
positions[t2DegreesAt] = 't2'
od = collections.OrderedDict(sorted(positions.items()))
values = list(od.values())
if values[0] == 't1' and values[len(values) - 1] == 't2' or (values[0] == 't2' and values[len(values) - 1] == 't1') or 't1t2' in ''.join(values) or ('t2t1' in ''.join(values)):
	print('YES')
else:
	print('NO')


(h, m, s, t1, t2) = list(map(int, input().split()))
h = h % 12 * 60 * 5 + m + s
t1 = t1 % 12 * 60 * 5
t2 = t2 % 12 * 60 * 5
m = m * 60 + s
s = s * 60
list = [(h, 'h'), (m, 'm'), (s, 's'), (t1, 't1'), (t2, 't2')]
l = list[:]
for j in range(4):
	if list[j][1] != 't1' and list[j][1] != 't2' and (list[j][0] == t1) or list[j][0] == t2:
		l.remove(list[j])
l.sort()
list = l[:]
for i in range(len(list)):
	if list[i][1] == 't1':
		if i != len(list) - 1 and i != 0:
			if list[i + 1][1] == 't2' or list[i - 1][1] == 't2':
				print('YES')
			else:
				print('NO')
		elif i == len(list) - 1:
			if list[0][1] == 't2' or list[-2][1] == 't2':
				print('YES')
			else:
				print('NO')
		elif i == 0:
			if list[i + 1][1] == 't2' or list[-1][1] == 't2':
				print('YES')
			else:
				print('NO')


from math import *

def secs(h, m, s):
	return h * 60 * 60 + m * 60 + s

def chop():
	return (int(i) for i in input().split())
(h, m, s, t1, t2) = chop()
sh = (h * 60 * 60 + m * 60 + s) % 43200
sm = (m * 60 + s) * 12 % 43200
ss = s * 720 % 43200
st1 = t1 * 60 * 60 % 43200
st2 = t2 * 60 * 60 % 43200
pr1 = []
(st1, st2) = (min(st1, st2), max(st1, st2))
for i in range(st1, st2 + 1):
	pr1.append(i)
pr2 = []
(st1, st2) = (max(st1, st2), min(st1, st2))
for i in range(st1, 43201):
	pr2.append(i)
for i in range(0, st2 + 1):
	pr2.append(i)
(f1, f2) = (False, False)
if sm in pr1 or ss in pr1 or sh in pr1:
	f1 = True
if sm in pr2 or ss in pr2 or sh in pr2:
	f2 = True
if f1 and f2:
	print('NO')
else:
	print('YES')


def bet(x):
	return t1 <= x <= t2 or t2 <= x + 3600 * 12 <= t1 or t2 <= x <= t1
read = lambda : map(int, input().split())
(h, m, s, t1, t2) = read()
h %= 12
t1 %= 12
t2 %= 12
N = 12 * 3600 + 10
nt = [0] * N
k1 = h * 3600 + 1
k2 = m * 720 + 1
k3 = s * 720
t1 *= 3600
t2 *= 3600
if t1 > t2:
	(t1, t2) = (t2, t1)
ans = 'NO'
flag = 1
if bet(k1) or bet(k2) or bet(k3):
	flag = 0
if flag:
	ans = 'YES'
flag = 1
t1 += 12 * 3600
if bet(k1) or bet(k2) or bet(k3):
	flag = 0
if flag:
	ans = 'YES'
print(ans)


(h, m, s, t1, t2) = map(int, input().split())
p = [0] * 12
p[(h + 1) % 12] = 1
p[(m // 5 + 1) % 12] = 1
p[(s // 5 + 1) % 12] = 1
q = [0] * 12
if m == s == 0:
	q[(h - 1) % 12] = 1
else:
	q[h % 12] = 1
if m % 5 == 0 and s == 0:
	q[(m // 5 - 1) % 12] = 1
else:
	q[m // 5 % 12] = 1
if s % 5 == 0:
	q[(s // 5 - 1) % 12] = 1
else:
	q[s // 5 % 12] = 1
i = t1 % 12
t2 = t2 % 12
d = True
while i != t2:
	i = (i + 1) % 12
	if p[i] == 1:
		i = t1 % 12
		while i != t2:
			i = (i + 11) % 12
			if q[i] == 1:
				d = False
				print('NO')
				break
		break
if d:
	print('YES')


(h, m, s, t1, t2) = list(map(int, input().split()))
h = h + m / 60 + s / 3600
m = m + s / 60
m = m * 12 / 60
s = s * 12 / 60
if t1 > t2:
	t3 = t1
	t1 = t2
	t2 = t3
numb = 0
if t1 < h < t2:
	numb += 1
if t1 < m < t2:
	numb += 1
if t1 < s < t2:
	numb += 1
if numb == 0 or numb == 3:
	print('YES')
else:
	print('NO')


(h, m, s, t1, t2) = [int(x) for x in input().split(' ')]
m += s / 60
h += m / 60
m /= 5
s /= 5
iarr = [('h', h % 12), ('m', m % 12), ('s', s % 12), ('t1', t1 % 12), ('t2', t2 % 12)]
arr = [('t1', t1 % 12), ('t2', t2 % 12)]
for idx in range(3):
	if not (iarr[idx][1] == iarr[-2][1] or iarr[idx][1] == iarr[-1][1]):
		arr.append(iarr[idx])
arr.sort(key=lambda x: x[1])
found = False
for idx in range(len(arr)):
	if arr[idx][0][0] == arr[(idx + 1) % len(arr)][0][0]:
		print('YES')
		found = True
		break
if not found:
	print('NO')


(h, m, s, t1, t2) = map(int, input().split())
k = min(t1, t2)
t = max(t1, t2)
l = 0
if s >= k * 5 and s < t * 5:
	l += 1
if m >= k * 5 and m < t * 5:
	l += 1
if h >= k and h < t:
	l += 1
if l > 0 and l < 3:
	print('NO')
else:
	print('YES')


(h, m, s, a, b) = list(map(int, input().split()))
m += s / 60
h += m / 60
m /= 5
s /= 5
c = [h, m, s, a, b]
c = c + list([x + 12 for x in c])
c = sorted(c)
p = c.index(a)
for x in [p - 1, p + 1]:
	for y in [b, b + 12]:
		if c[x] == y:
			print('YES')
			return
print('NO')


def zero_based(hour):
	return hour if hour < 12 else 0
(h, m, s, t1, t2) = map(int, input().split())
(t1, t2) = sorted([t1, t2])
h *= 5
t1 *= 5
t2 *= 5
can_reach = False
if s > 0:
	m += 0.5
if m > 0:
	h += 0.5
if t2 > h and h > t1:
	can_reach = t2 > m and m > t1 and (t2 > s) and (s > t1)
else:
	can_reach = not (t2 > m and m > t1) and (not (t2 > s and s > t1))
print('YES' if can_reach else 'NO')


(h, m, s, x, y) = map(int, input().split())
h = h + m / 60 + s / 3600
m = m / 5
s = s / 5
l = [h, m, s, x, y]
l.sort()
z = abs(l.index(x) - l.index(y))
if z == 1 or z == 4:
	print('YES')
else:
	print('NO')


import math

def func(a):
	(h, m, s, x, y) = a
	m = m // 5
	s = s // 5
	b = [h, m, s]
	b.sort()
	(r1, r2) = (0, 0)
	if x in range(b[0] + 1, b[1] + 1):
		r1 = 1
	elif x in range(b[1] + 1, b[2] + 1):
		r1 = 2
	else:
		r1 = 3
	if y in range(b[0] + 1, b[1] + 1):
		r2 = 1
	elif y in range(b[1] + 1, b[2] + 1):
		r2 = 2
	else:
		r2 = 3
	if r1 == r2:
		return 'YES'
	return 'NO'
for _ in range(1):
	a = list(map(int, input().split()))
	print(func(a))


from math import sqrt
import heapq

def main():
	(h, m, s, t1, t2) = [int(x) for x in input().split(' ')]
	hdeg = (h * 30 + m / 60 * 30 + s / 3600 * 30) % 360
	mdeg = (m * 6 + s / 60 * 6) % 360
	sdeg = s * 6 % 360
	start = t1 * 30 % 360
	end = t2 * 30 % 360
	if end < start:
		(start, end) = (end, start)
	if hdeg > end or mdeg > end or sdeg > end:
		pass
	elif hdeg < start or mdeg < start or sdeg < start:
		pass
	else:
		print('YES')
		return
	if start < hdeg < end or start < mdeg < end or start < sdeg < end:
		pass
	else:
		print('YES')
		return
	print('NO')
main()


def check1(h):
	global t1, t2
	if h == t1 or h == t2:
		return -1
	if h > min(t1, t2) and h < max(t1, t2):
		return 1
	else:
		return 0

def check2(m):
	if m == 5 * t1 or m == 5 * t2:
		return -1
	if m > 5 * min(t1, t2) and m < 5 * max(t1, t2):
		return 1
	else:
		return 0
(h, m, s, t1, t2) = list(map(int, input().split()))
if m != 0 or s != 0:
	h += 0.5
if s != 0:
	m += 0.5
if h > 12:
	h -= 12
l = [check1(h), check2(m), check2(s)]
for i in range(len(l) - 1, -1, -1):
	if l[i] == -1:
		l.pop(i)
flag = 0
for val in l:
	if val != l[0]:
		flag = 1
		break
if flag:
	print('NO')
else:
	print('YES')


(h, m, s, t1, t2) = map(int, input().split())
h = h * 5 % 60
t1 = t1 * 5 % 60
t2 = t2 * 5 % 60
if h <= m <= s:
	if t1 > s and t2 > s:
		print('YES')
	elif t1 <= h and t2 <= h:
		print('YES')
	elif t1 <= h and t2 > s:
		print('YES')
	elif t1 > s and t2 <= h:
		print('YES')
	elif h < t1 <= m and h < t2 <= m:
		print('YES')
	elif m < t1 <= s and m < t2 <= s:
		print('YES')
	else:
		print('NO')
elif h <= s <= m:
	if t1 > m and t2 > m:
		print('YES')
	elif t1 <= h and t2 <= h:
		print('YES')
	elif t1 <= h and t2 > m:
		print('YES')
	elif t1 > m and t2 <= h:
		print('YES')
	elif h < t1 <= s and h < t2 <= s:
		print('YES')
	elif s < t1 <= m and s < t2 <= m:
		print('YES')
	else:
		print('NO')
elif m <= h <= s:
	if t1 > s and t2 > s:
		print('YES')
	elif t1 <= m and t2 <= m:
		print('YES')
	elif t1 <= m and t2 > s:
		print('YES')
	elif t1 > s and t2 <= m:
		print('YES')
	elif m < t1 <= h and m < t2 <= h:
		print('YES')
	elif h < t1 <= s and h < t2 <= s:
		print('YES')
	else:
		print('NO')
elif m <= s <= h:
	if t1 > h and t2 > h:
		print('YES')
	elif t1 <= m and t2 <= m:
		print('YES')
	elif t1 <= m and t2 > h:
		print('YES')
	elif t1 > h and t2 <= m:
		print('YES')
	elif m < t1 <= s and m < t2 <= s:
		print('YES')
	elif s < t1 <= h and s < t2 <= h:
		print('YES')
	else:
		print('NO')
elif s <= h <= m:
	if t1 > m and t2 > m:
		print('YES')
	elif t1 <= s and t2 <= s:
		print('YES')
	elif t1 <= s and t2 > m:
		print('YES')
	elif t1 > m and t2 <= s:
		print('YES')
	elif s < t1 <= h and s < t2 <= h:
		print('YES')
	elif h < t1 <= m and h < t2 <= m:
		print('YES')
	else:
		print('NO')
elif s <= m <= h:
	if t1 > h and t2 > h:
		print('YES')
	elif t1 < s and t2 < s:
		print('YES')
	elif t1 <= s and t2 > h:
		print('YES')
	elif t1 > h and t2 <= s:
		print('YES')
	elif s < t1 <= m and s < t2 <= m:
		print('YES')
	elif m < t1 <= h and m < t2 <= h:
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline

def prog():
	(h, m, s, t1, t2) = map(int, input().split())
	marked = [0] * 3600 * 12
	h = h % 12
	t1 = t1 % 12
	t2 = t2 % 12
	marked[3600 * h + 60 * m + s] = 1
	marked[720 * m + 12 * s] = 1
	marked[720 * s] = 1
	(t1, t2) = (min(t1, t2), max(t1, t2))
	t1 *= 3600
	t2 *= 3600
	fail = False
	for i in range(t1 + 1, t2):
		if marked[i]:
			fail = True
	if not fail:
		print('YES')
	else:
		fail = False
		for i in range(3600 * 12 - 1, t2, -1):
			if marked[i]:
				fail = True
		for i in range(t1):
			if marked[i]:
				fail = True
		if not fail:
			print('YES')
		else:
			print('NO')
prog()


def main():
	(m1, m2, m3, t1, t2) = tuple(map(int, input().split()))
	t1 *= 3600
	c = 3600 * 12
	t2 = t2 * 3600 % c
	l = [m1 * 3600 % c, m2 * 3600 / 5 % c, m3 * 3600 / 5]

	def ans(p):
		last = 100000000
		if t1 % c in l and p == 1:
			return False
		for i in range(c):
			cc = (t1 + i * p) % c
			if last in l or last - c in l:
				return False
			if cc == t2:
				if t2 in l:
					return p == 1
				return True
			if i > 1:
				last = cc - p
	return 'YES' if ans(1) or ans(-1) else 'NO'
print(main())


def solve():
	(hour, minute, second, t1, t2) = [int(st) for st in input().split(' ')]
	angle_hour = 360 * (hour + minute / 60 + second / 3600) / 12
	angle_minute = 360 * (minute + second / 60) / 60
	angle_second = 360 * second / 60
	angle_t1 = 360 * t1 / 12
	angle_t2 = 360 * t2 / 12
	if angle_hour > 360:
		angle_hour -= 360
	if angle_minute > 360:
		angle_minute -= 360
	anglelist = [angle_hour, angle_minute, angle_second]
	if angle_t1 > angle_t2:
		(angle_t1, angle_t2) = (angle_t2, angle_t1)
	(statusT12, statusT21) = (True, True)
	for angle in anglelist:
		if angle_t1 < angle and angle < angle_t2:
			statusT12 = False
		if angle_t2 < angle or angle_t1 > angle:
			statusT21 = False
	ans = {True: 'YES', False: 'NO'}
	return ans[statusT12 or statusT21]
print(solve())


import math, copy
from collections import defaultdict, Counter
from itertools import permutations

def fact(n):
	return 1 if n == 1 or n == 0 else n * fact(n - 1)

def prime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def inp():
	l = list(map(int, input().split()))
	return l

def main():
	(h, m, s, t1, t2) = inp()
	t1 = t1 % 12
	t2 = t2 % 12
	p = s / 60 * 12 % 12
	q = (m / 60 + s / 3600) * 12 % 12
	r = (h + (m / 60 + s / 3600)) % 12
	l = [p, q, r]
	l.sort()
	c = False
	for i in range(t1, 100):
		ii = i % 12
		if ii == t2:
			c = True
			break
		if ii <= l[0] <= ii + 1 or ii <= l[1] <= ii + 1 or ii <= l[2] <= ii + 1:
			break
	for i in range(t2, 100):
		ii = i % 12
		if ii == t1:
			c = True
			break
		if ii <= l[0] <= ii + 1 or ii <= l[1] <= ii + 1 or ii <= l[2] <= ii + 1:
			break
	if c:
		print('YES')
	else:
		print('NO')
import os, sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()

def random():
	rating = 100
	rating = rating * 100
	rating = rating * 100
	print(rating)

def random():
	rating = 100
	rating = rating * 100
	rating = rating * 100
	print(rating)

def random():
	rating = 100
	rating = rating * 100
	rating = rating * 100
	print(rating)

def random():
	rating = 100
	rating = rating * 100
	rating = rating * 100
	print(rating)


(h, m, s, a, b) = map(int, input().split())
(x, y, z) = sorted([h + m / 60 + s / 3600, m / 5 + s / 300, s / 5])
if a > b:
	(a, b) = (b, a)
d = (x < a) * (b < y) + (y < a) * (b < z) + (b > z) * (a < x) + (b < x) + (a > z)
print('YES' if d else 'NO')


import sys
(h, m, s, t1, t2) = map(lambda x: int(x), sys.stdin.read().split())
h = h if h != 12 else 0
m == m if m != 60 else 0
t1 = t1 if t1 != 12 else 0
t2 = t2 if t2 != 12 else 0
ha = 30 * h + 0.5 * m + s / 120
ma = 6 * m + 0.1 * s
sa = 6 * s
t1a = 30 * t1
t2a = 30 * t2
tmin = min(t1a, t2a)
tmax = max(t1a, t2a)
result = False
if all((tmin < x < tmax for x in (ha, ma, sa))):
	result = True
elif all((x < tmin or x > tmax for x in (ha, ma, sa))):
	result = True
if result:
	print('YES')
else:
	print('NO')


(h, m, s, t1, t2) = tuple(map(int, input().split()))
t2 = t2 % 12 * 5
t1 = t1 % 12 * 5
s = float(s)
m = float(m + s / 60)
h = float(h % 12 * 5 + m / 12)

def dt(u, v):
	if v < u:
		return 60 - u + v
	return v - u

def check(t1, t2, h, m, s):
	d = dt(t1, t2)
	return d < dt(t1, h) and d < dt(t1, m) and (d < dt(t1, s))
r = check(t1, t2, h, m, s) or check(t2, t1, h, m, s)
print('YES' if r else 'NO')


(h, m, s, t1, t2) = map(int, input().split())
t = [t1, t2]
hms = [h, m / 5, s / 5]
ans = [[0, 0] for i in range(3)]
for i in range(2):
	for j in range(3):
		ans[j][i] = t[i] > hms[j]
ans2 = [(ans[i][0] + ans[i][1]) % 2 for i in range(3)]
if sum(ans2) == 3 or sum(ans2) == 0:
	print('YES')
else:
	print('NO')


import math
import collections
import bisect
import heapq
import time
import random
(H, M, S, t1, t2) = map(int, input().split())
h = H % 12 * 60 * 60 + M * 60 + S
m = M * 12 * 60 + S * 12
s = S * 12 * 60
t1 = t1 % 12 * 3600
t2 = t2 % 12 * 3600
if t1 > t2:
	(t1, t2) = (t2, t1)
if not (t1 < h < t2 or t1 < m < t2 or t1 < s < t2):
	print('YES')
	exit(0)
if not ((t2 < h or h < t1) or (t2 < m or m < t1) or (t2 < s or s < t1)):
	print('YES')
	exit(0)
print('NO')


import sys

def ReadInput():
	return sys.stdin.read().splitlines()

def Check(start, end, block, step):
	while start != end:
		start += step
		if start < 0:
			start += 24
		if start >= 24:
			start -= 24
		if start in block:
			return False
	return True

def main():
	input = ReadInput()
	[h, m, s, t1, t2] = [int(x) for x in input[0].split(' ')]
	h = h * 2 + 1
	h %= 24
	m = m // 5 * 2 + 1
	m %= 24
	s = s // 5 * 2 + 1
	s %= 24
	t1 = t1 * 2
	t1 %= 24
	t2 = t2 * 2
	t2 %= 24
	start = min(t1, t2)
	end = max(t1, t2)
	if Check(start, end, [h, m, s], 1) or Check(start, end, [h, m, s], -1):
		print('YES')
		return
	print('NO')
main()


(h, m, s, t1, t2) = map(int, input().split())
a = s / 60
b = (m + a) / 60
c = (h + b) / 12
t1 /= 12
t2 /= 12
d = [a, b, c, t1, t2]
d.sort()
if d.index(t1) == 0 and (d.index(t2) == 4 or d.index(t2) == 1) or (d.index(t1) == 1 and (d.index(t2) == 2 or d.index(t2) == 0)) or (d.index(t1) == 2 and (d.index(t2) == 3 or d.index(t2) == 1)) or (d.index(t1) == 3 and (d.index(t2) == 4 or d.index(t2) == 2)) or (d.index(t1) == 4 and (d.index(t2) == 3 or d.index(t2) == 0)):
	print('YES')
else:
	print('NO')


(h, m, s, t1, t2) = [int(z) for z in input().split()]
if h == 12:
	h = 0
adds = s / 60
s = adds * 12
addm = (m + adds) / 60
m = addm * 12
h += addm
if h <= m <= s:
	if h < t1 < m and h < t2 < m:
		print('YES')
		exit(0)
	if m < t1 < s and m < t2 < s:
		print('YES')
		exit(0)
	if (s < t1 <= 12 or 1 <= t1 < h) and (s < t2 <= 12 or 1 <= t2 < h):
		print('YES')
		exit(0)
elif h <= s <= m:
	if h < t1 < s and h < t2 < s:
		print('YES')
		exit(0)
	if s < t1 < m and s < t2 < m:
		print('YES')
		exit(0)
	if (m < t1 <= 12 or 1 <= t1 < h) and (m < t2 <= 12 or 1 <= t2 < h):
		print('YES')
		exit(0)
elif m <= h <= s:
	if m < t1 < h and m < t2 < h:
		print('YES')
		exit(0)
	if h < t1 < s and h < t2 < s:
		print('YES')
		exit(0)
	if (s < t1 <= 12 or 1 <= t1 < m) and (s < t2 <= 12 or 1 <= t2 < m):
		print('YES')
		exit(0)
elif s <= h <= m:
	if s < t1 < h and s < t2 < h:
		print('YES')
		exit(0)
	if h < t1 < m and h < t2 < m:
		print('YES')
		exit(0)
	if (m < t1 <= 12 or 1 <= t1 < s) and (m < t2 <= 12 or 1 <= t2 < s):
		print('YES')
		exit(0)
elif s <= m <= h:
	if s < t1 < m and s < t2 < m:
		print('YES')
		exit(0)
	if m < t1 < h and m < t2 < h:
		print('YES')
		exit(0)
	if (h < t1 <= 12 or 1 <= t1 < s) and (h < t2 <= 12 or 1 <= t2 < s):
		print('YES')
		exit(0)
elif m <= s <= h:
	if m < t1 < s and m < t2 < s:
		print('YES')
		exit(0)
	if s < t1 < h and s < t2 < h:
		print('YES')
		exit(0)
	if (h < t1 <= 12 or 1 <= t1 < m) and (h < t2 <= 12 or 1 <= t2 < m):
		print('YES')
		exit(0)
print('NO')


import sys
read = sys.stdin.readline

def solve(h, m, s, t1, t2):
	h = (h % 12 + m / 60 + s / 3600) * 5
	m = m + s / 60
	t1 = t1 % 12 * 5
	t2 = t2 % 12 * 5
	a = min(t1, t2)
	b = max(t1, t2)
	h_inner = a < h and h < b
	m_inner = a < m and m < b
	s_inner = a < s and s < b
	if h_inner and m_inner and s_inner:
		return 'YES'
	if not h_inner and (not m_inner) and (not s_inner):
		return 'YES'
	return 'NO'

def run():
	(h, m, s, t1, t2) = list(map(int, read().replace('\n', '').split()))
	print(solve(h, m, s, t1, t2))
run()


x = [int(i) for i in input().split()]
s = x[0] * 60 * 60 + x[1] * 60 + x[2]
h = x[0] * 360 // 12 % 360 + 30 / 60 * x[1] + 0.5 / 60 * x[2]
m = x[1] * 360 // 60 % 360 + 6 / 60 * x[2]
s = x[2] * 360 // 60 % 360
t1 = x[3] * 360 // 12 % 360
t2 = x[4] * 360 // 12 % 360
if t2 < t1:
	(t1, t2) = (t2, t1)
y = set()
y.add(h)
y.add(m)
y.add(s)
y = sorted(list(y))
answ = 'NO'
for i in range(1, len(y)):
	if t1 >= y[i - 1] and t1 <= y[i] and (t2 >= y[i - 1]) and (t2 <= y[i]) or (t1 >= y[i - 1] and t2 >= y[i - 1] and (t1 < y[i]) and (t2 <= y[i])):
		answ = 'YES'
		break
if y[0] >= t1 and y[len(y) - 1] <= t2 or (y[0] >= t1 and y[0] >= t2) or (y[len(y) - 1] <= t1 and y[len(y) - 1] <= t2):
	answ = 'YES'
print(answ)


def clc(a, b, c):
	if min(a, c) == c and a != c or (min(b, c) == b or b == c):
		return 0
	else:
		return 1
(h, m, s, t1, t2) = map(int, input().split())
h = 5 * h % 60
t1 = 5 * t1 % 60
t2 = 5 * t2 % 60
(t1, t2) = (min(t1, t2), max(t1, t2))
if clc(t1, t2, h) == clc(t1, t2, m) and clc(t1, t2, m) == clc(t1, t2, s):
	print('YES')
else:
	print('NO')


def main():
	(h, m, s, t1, t2) = map(int, input().split())
	m = (m + s / 60) / 5
	s = s / 5
	h = h + m / 60
	times = [h, m, s]
	times.sort()
	if times[0] < t1 < times[1] and times[0] < t2 < times[1] or (times[1] < t1 < times[2] and times[1] < t2 < times[2]) or ((times[2] < t1 <= 12 or times[2] < t2 <= 12) and (0 <= t1 < times[0] or 0 <= t2 < times[0])) or (times[2] < t2 <= 12 and times[2] < t1 <= 12 or (0 <= t1 < times[0] and 0 <= t2 < times[0])):
		print('YES')
	else:
		print('NO')
main()


from sys import stdin
(h, m, s, t1, t2) = [int(i) for i in stdin.readline().split(' ')]
borders = sorted([5 * h, m, s])
bool1a = 5 * t1 <= borders[0] or borders[2] < 5 * t1
bool1b = 5 * t2 <= borders[0] or borders[2] < 5 * t2
bool2a = borders[0] < 5 * t1 and 5 * t1 <= borders[1]
bool2b = borders[0] < 5 * t2 and 5 * t2 <= borders[1]
bool3a = borders[1] < 5 * t1 and 5 * t1 <= borders[2]
bool3b = borders[1] < 5 * t2 and 5 * t2 <= borders[2]
if (bool1a and bool1b or (bool2a and bool2b)) or (bool3a and bool3b):
	print('YES')
else:
	print('NO')


(h, m, s, t1, t2) = map(int, input().split())
splits = [False] * 12
m = m // 5
s = s // 5
splits[h % 12] = True
splits[m % 12] = True
splits[s % 12] = True
start = t1 % 12
end = t2 % 12
if start > end:
	a = splits[start:] + splits[:end]
	b = splits[end:start]
else:
	a = splits[:start] + splits[end:]
	b = splits[start:end]
if True in a and True in b:
	print('NO')
else:
	print('YES')