import sys

input = sys.stdin.readline



# 加算・減算の回数を固定すると範囲が決まる



import numpy as np



N,A,B,C,D = list(map(int,input().split()))



# 加算の回数をもとに

rng = np.arange(N,dtype=np.int64)

upper = D*rng - C*rng[::-1]

lower = C*rng - D*rng[::-1]



answer = 'YES' if ((lower <= B-A) & (B-A <= upper)).any() else 'NO'

print(answer)
import sys

import numpy as np



read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



N, A, B, C, D = list(map(int, read().split()))



N -= 1



x = np.arange(N + 1, dtype=np.int64)  # 増加回数

low = C * x - D * (N - x)

high = D * x - C * (N - x)



diff = B - A

cond = np.any((low <= diff) & (diff <= high))

print(('YES' if cond else 'NO'))
import sys

input = sys.stdin.readline
# 加算・減算の回数を固定すると範囲が決まる
import numpy as np

N, A, B, C, D = list(map(int, input().split()))
# 加算の回数をもとに
rng = np.arange(N, dtype=np.int64)
upper = D * rng - C * rng[::-1]
lower = C * rng - D * rng[::-1]
answer = "YES" if ((lower <= B - A) & (B - A <= upper)).any() else "NO"
print(answer)

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, A, B, C, D = list(map(int, read().split()))
N -= 1
x = np.arange(N + 1, dtype=np.int64)  # 増加回数
low = C * x - D * (N - x)
high = D * x - C * (N - x)
diff = B - A
cond = np.any((low <= diff) & (diff <= high))
print(("YES" if cond else "NO"))

- -input = sys.stdin.readline -# 加算・減算の回数を固定すると範囲が決まる -N, A, B, C, D = list(map(int, input().split())) -# 加算の回数をもとに -rng = np.arange(N, dtype=np.int64) -upper = D * rng - C * rng[::-1] -lower = C * rng - D * rng[::-1] -answer = "YES" if ((lower <= B - A) & (B - A <= upper)).any() else "NO" -print(answer) +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +N, A, B, C, D = list(map(int, read().split())) +N -= 1 +x = np.arange(N + 1, dtype=np.int64)  # 増加回数 +low = C * x - D * (N - x) +high = D * x - C * (N - x) +diff = B - A +cond = np.any((low <= diff) & (diff <= high)) +print(("YES" if cond else "NO"))