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



for i in range(N):

    minimum = A + C * i - (N - 1 - i) * D

    maximum = A + D * i - (N - 1 - i) * C

    if minimum <= B <= maximum:

        print('YES')

        exit()

else:

    print('NO')

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



left = 0

right = N

if A > B:

    A, B = B, A





def solve(n):

    minimum = A + C * n - (N - 1 - n) * D

    maximum = A + D * n - (N - 1 - n) * C

    if minimum <= B <= maximum:

        print('YES')

        exit()

    elif B < minimum:

        return False

    else:

        return True





while right - left > 1:

    mid = (right + left) // 2

    if solve(mid):

        left = mid

    else:

        right = mid

else:

    print('NO')

N, A, B, C, D = list(map(int, input().split()))
for i in range(N):
    minimum = A + C * i - (N - 1 - i) * D
    maximum = A + D * i - (N - 1 - i) * C
    if minimum <= B <= maximum:
        print("YES")
        exit()
else:
    print("NO")

N, A, B, C, D = list(map(int, input().split()))
left = 0
right = N
if A > B:
    A, B = B, A


def solve(n):
    minimum = A + C * n - (N - 1 - n) * D
    maximum = A + D * n - (N - 1 - n) * C
    if minimum <= B <= maximum:
        print("YES")
        exit()
    elif B < minimum:
        return False
    else:
        return True


while right - left > 1:
    mid = (right + left) // 2
    if solve(mid):
        left = mid
    else:
        right = mid
else:
    print("NO")

-for i in range(N): -    minimum = A + C * i - (N - 1 - i) * D -    maximum = A + D * i - (N - 1 - i) * C +left = 0 +right = N +if A > B: +    A, B = B, A + + +def solve(n): +    minimum = A + C * n - (N - 1 - n) * D +    maximum = A + D * n - (N - 1 - n) * C +    elif B < minimum: +        return False +    else: +        return True + + +while right - left > 1: +    mid = (right + left) // 2 +    if solve(mid): +        left = mid +    else: +        right = mid