The circle line of the Roflanpolis subway has $n$ stations.

There are two parallel routes in the subway. The first one visits stations in order $1 \to 2 \to \ldots \to n \to 1 \to 2 \to \ldots$ (so the next stop after station $x$ is equal to $(x+1)$ if $x < n$ and $1$ otherwise). The second route visits stations in order $n \to (n-1) \to \ldots \to 1 \to n \to (n-1) \to \ldots$ (so the next stop after station $x$ is equal to $(x-1)$ if $x>1$ and $n$ otherwise). All trains depart their stations simultaneously, and it takes exactly $1$ minute to arrive at the next station.

Two toads live in this city, their names are Daniel and Vlad.

Daniel is currently in a train of the first route at station $a$ and will exit the subway when his train reaches station $x$.

Coincidentally, Vlad is currently in a train of the second route at station $b$ and he will exit the subway when his train reaches station $y$.

Surprisingly, all numbers $a,x,b,y$ are distinct.

Toad Ilya asks you to check if Daniel and Vlad will ever be at the same station at the same time during their journey. In other words, check if there is a moment when their trains stop at the same station. Note that this includes the moments when Daniel or Vlad enter or leave the subway.


-----Input-----

The first line contains five space-separated integers $n$, $a$, $x$, $b$, $y$ ($4 \leq n \leq 100$, $1 \leq a, x, b, y \leq n$, all numbers among $a$, $x$, $b$, $y$ are distinct) — the number of stations in Roflanpolis, Daniel's start station, Daniel's finish station, Vlad's start station and Vlad's finish station, respectively.


-----Output-----

Output "YES" if there is a time moment when Vlad and Daniel are at the same station, and "NO" otherwise. You can print each letter in any case (upper or lower).


-----Examples-----
Input
5 1 4 3 2

Output
YES

Input
10 2 1 9 10

Output
NO



-----Note-----

In the first example, Daniel and Vlad start at the stations $(1, 3)$. One minute later they are at stations $(2, 2)$. They are at the same station at this moment. Note that Vlad leaves the subway right after that.

Consider the second example, let's look at the stations Vlad and Daniel are at. They are:   initially $(2, 9)$,  after $1$ minute $(3, 8)$,  after $2$ minutes $(4, 7)$,  after $3$ minutes $(5, 6)$,  after $4$ minutes $(6, 5)$,  after $5$ minutes $(7, 4)$,  after $6$ minutes $(8, 3)$,  after $7$ minutes $(9, 2)$,  after $8$ minutes $(10, 1)$,  after $9$ minutes $(1, 10)$. 

After that, they both leave the subway because they are at their finish stations, so there is no moment when they both are at the same station.

Difficulty: interview

Starter code:

Solutions:
n, a, x, b, y = map(int, input().split())

while a != x and b != y and a != b:
	if a == b:
		break

	a = a % n + 1
	b = b - 1 if b - 1 else n

print("YNEOS"[a != b::2])

n, a, x, b, y = list(map(int, input().split()))
a -= 1
x -= 1
b -= 1
y -= 1

daniel = []
vlad = []
i = a
while i != x:
    daniel.append(i)
    i = (i + 1) % n
daniel.append(x)
i = b
while i != y:
    vlad.append(i)
    i = (i - 1 + n) % n
vlad.append(y)

if any(u == v for u, v in zip(daniel, vlad)):
    print('YES')
else:
    print('NO')


n,a,x,b,y = list(map(int,input().split()))
a -= 1
x -= 1
b -= 1
y -= 1
while True:
    if a == b:
        print("YES")
        break
    if a == x or b == y:
        print("NO")
        break
    a = (a+1)%n
    b = (b-1)%n


n, a, x, b, y = list(map(int, input().split()))
ans = 'NO'
if a == b:
    ans = 'YES'
while a != x and b != y:
    if a == n:
        a = 0
    a += 1
    if b == 1:
        b = n + 1
    b -= 1
    if a == b:
        ans = 'YES'
print(ans)

''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''
#codeforces1169A_live
gi = lambda : list(map(int,input().strip().split()))
n,a, x, b, y = gi()
while a != x and b != y:
	a += 1
	if a > n:
		a = 1
	b -= 1
	if b <= 0:
		b = n
	if a == b:
		print("YES")
		return
print("NO")

#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
t=1
for tt in range(t):
    #n=int(input())
    n,a,x,b,y= map(int, sys.stdin.readline().split(' '))

    while 1:
        if a==x or b==y:
            break

        if a==b:
            break
        if(a<n):
            a+=1
        else:
            a=1

        if(b>1):
            b-=1
        else:
            b=n
    if a==b:
        print("YES")
    else:
        print("NO")

    #a=list(map(int,sys.stdin.readline().split(' ')))
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

n, a, x, b, y = list(map(int, input().split()))
while a != x and b != y:
    a += 1
    b -= 1
    if a == n + 1:
        a = 1
    if b == 0:
        b = n
    if a == b:
        print('YES')
        return
##    print(a, b)
print('NO')


import sys
input = sys.stdin.readline


class Problem:
    def __init__(self):
        pass

    def solve(self):
        print(self._solve())

    def _solve(self):
        n, a, x, b, y = [int(item) for item in input().split()]
        a -= 1
        b -= 1
        x -= 1
        y -= 1
        if (a == b):
            return "YES"
        for i in range(n):
            a = (a + 1) % n
            b = (b - 1) % n
            if a == b:
                return "YES"
            if b == y or a == x:
                break

        return "NO"


def main():
    problem = Problem()
    problem.solve()


def __starting_point():
    main()

__starting_point()

n, a, x, b, y = list(map(int, input().split()))
z1 = a
z2 = b
import sys
while True:
	if z1 == z2:
		print("YES")
		return
	if z1 == x or z2 == y:
		print("NO")
		return
	z1 = (z1 % n) + 1
	if z2 == 1:
		z2 = n
	else:
		z2 -= 1



def main():
    n,a,x,b,y = list(map(int,input().split()))
    same = False
    while True:
        if a != x:
            a += 1
        else:
            break
        if b != y:
            b -= 1
        else:
            break
        if a == n+1:
            a = 1
        if b == 0:
            b = n

        if a == b:
            break

    if a == b:
        print('YES')
    else:
        print('NO')


main()


def main():
    n, a,x,b,y = map(int, input().strip().split())
    a -= 1
    x -= 1
    b -= 1
    y -= 1
    cf = a
    cs = b

    if a == b:
        print('YES')
        return
    while cf != x and cs != y:
        cf += 1
        cf %= n
        cs += (n - 1)
        cs %= n
        if cf == cs:
            print('YES')
            return
    print('NO')
    return

def __starting_point():
    main()
__starting_point()

def main():
    n, a, x, b, y = list(map(int, input().split()))
    flag = False
    for i in range(n):
        if a == b:
            flag = True
        if a == x:
            break
        if b == y:
            break
        a += 1
        b -= 1
        if a == n + 1:
            a = 1
        if b == 0:
            b = n
    if flag:
        print('YES')
    else:
        print('NO')

main()


n, a, x, b, y = map(int, input().split())
a -= 1
b -= 1
x -= 1
y -= 1
res = a == b
while a != x and b != y:
    if a != x: a = (a + 1) % n
    if b != y: b = (b - 1) % n
    res |= a == b

print("YES" if res else "NO")

n,a,x,b,y=list(map(int,input().split()))
fl=0
while True:
    a+=1
    if a==n+1:
        a=1
    b-=1
    if b==0:
        b=n
    if a==b:
        fl=1
        break
    elif a==x or b==y:
        break
if fl:
    print('YES')
else:
    print('NO')
        


n,a,x,b,y = map(int,input().split())

t_a = [a]
current = a
while current != x:
    current += 1
    if current == (n+1):
        current = 1
    t_a.append(current)

t_b = [b]
current = b
while current != y:
    current -= 1
    if current == 0:
        current = n
    t_b.append(current)
steps = min(len(t_a),len(t_b))

for i in range(steps):
    if t_a[i] == t_b[i]:
        print ("YES")
        return
print ("NO")

n,a,x,b,y=list(map(int, input().split()))
a-=1
x-=1
b-=1
y-=1
while a != x and b != y:
    if a == b:
        print('YES')
        raise SystemExit(0)
    a = (a + 1) % n
    b = (b - 1 + n) % n
if a == b:
    print('YES')
else:
    print('NO')


def main():
    n, a, x, b, y = map(int, input().split())
    a -= 1
    x -= 1
    b -= 1
    y -= 1
    if x < a:
        x += n
    if y > b:
        b += n
    while a != x and b != y:
        a += 1
        b -= 1
        if a % n == b % n:
            print("YES")
            return 0
    print("NO")
    return 0

main()

n, a, x, b, y = list(map(int,input().split()))

while(a != x and b != y):
    a = (a)%n + 1
    b = (b - 2)%n + 1
    if(a == b):
        print('YES')
        return
    if(a == x or b == y):
        break
print('NO')


import sys
# gcd
# from fractions import gcd
# from math import ceil, floor
# from copy import deepcopy
# from itertools import accumulate
# l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', 'c', 'b', 'c', 'b', 'a']
# print(S.most_common(2))  # [('b', 5), ('c', 4)]
# print(S.keys())  # dict_keys(['a', 'b', 'c'])
# print(S.values())  # dict_values([3, 5, 4])
# print(S.items())  # dict_items([('a', 3), ('b', 5), ('c', 4)])
# from collections import Counter
# import math
# from functools import reduce
#
# fin = open('in_1.txt', 'r')
# sys.stdin = fin
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return list(map(int, input().rstrip().split()))
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
# template


def __starting_point():

    # write code
    n, a, x, b, y = mi()
    while (a % n != x % n and b % n != y % n):
        a += 1
        a %= n
        b -= 1
        b %= n
        if a % n == b % n:
            print('YES')
            break
    else:
        print('NO')

__starting_point()

n,a,x,b,y = list(map(int, input().split(' ')))
a -= 1
x -= 1
b -= 1
y -= 1
while True :
    if a == b :
        print("YES")
        break
    elif a == x or b == y :
        print("NO")
        break
    else :
        a = (a+1)%n
        b = (b-1)%n


n, a, x, b, y = [int(x) for x in input().split()]

ar = []
br = []

if a < x:
    ar = list(range(a, x+1))
else:
    ar = list(range(a, n+1)) + list(range(1, x+1))

if b > y:
    br = list(range(b, y-1, -1))
else:
    br = list(range(b, 0, -1)) + list(range(n, y-1, -1))

can = False

for i in range(min(len(ar), len(br))):
    if ar[i] == br[i]:
        can = True

if can:
    print("YES")
else:
    print("NO")

n,a,x,b,y = list(map(int,input().split()))
join = False
#print(min((x-a)%n, (b-y)%n))
for k in range(min((x-a)%n, (b-y)%n)+1):
	if a==b:
		join = True
	a+=1
	a%=n
	b-=1
	b%=n
if join:
	print('YES')
else:
	print('NO')


#	!/usr/bin/env python3
#	encoding: UTF-8
#	Modified: <26/May/2019 09:11:38 PM>


#	✪ H4WK3yE乡
#	Mohd. Farhan Tahir
#	Indian Institute Of Information Technology (IIIT), Gwalior


import sys


def get_array(): return list(map(int, sys.stdin.readline().split()))


def get_ints(): return list(map(int, sys.stdin.readline().split()))


def input(): return sys.stdin.readline().strip()


def main():
    n, a, x, b, y = get_ints()
    daniel = [-1] * (n + 1)
    if x >= a:
        t = 0
        for i in range(a, x + 1):
            daniel[i] = t
            t += 1
    else:
        t = 0
        for i in range(a, n + 1):
            daniel[i] = t
            t += 1
        for i in range(1, x + 1):
            daniel[i] = t
            t += 1

    vlad = [-1] * (n + 1)
    if y <= b:
        t = 0
        for i in range(b, y - 1, -1):
            vlad[i] = t
            t += 1
    else:
        t = 0
        for i in range(b, 0, -1):
            vlad[i] = t
            t += 1
        for i in range(n, y - 1, -1):
            vlad[i] = t
            t += 1
    ans = 'NO'
    for i in range(1, n + 1):
        if daniel[i] == vlad[i] and daniel[i] != -1:
            ans = 'YES'
            break
    # print(vlad)
    # print(daniel)
    print(ans)


def __starting_point():
    main()

__starting_point()

def main():
    n, a, x, b, y = map(int, input().split(' '))
    while a != x and b != y:
        a = a + 1
        b = b - 1
        if a == n + 1:
            a = 1
        if b == 0:
            b = n
        if a == b:
            print("YES")
            return
    print("NO")
    return

main()