#import <stdio.h>
typedef long long Int;
int main() {
	Int n,a,b,c,d;
	scanf("%lld %lld %lld %lld %lld",&n,&a,&b,&c,&d);
	for(Int i=0;i<=n;i++){
	    Int x = -(n-1-i)*d + i*c;
		Int y = -(n-1-i)*c + i*d;
		if(x <= b-a && b-a <= y){
			puts("YES");
			return 0;
		}
	}
	puts("NO");
	return 0;
}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_750/source.m'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/ObjectiveC/Source_750/source.m"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@.str = private unnamed_addr constant [25 x i8] c"%lld %lld %lld %lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1

; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
  %n = alloca i64, align 8
  %a = alloca i64, align 8
  %b = alloca i64, align 8
  %c = alloca i64, align 8
  %d = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #3
  %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
  %0 = load i64, ptr %n, align 8, !tbaa !5
  %cmp.not31 = icmp slt i64 %0, 0
  br i1 %cmp.not31, label %cleanup19, label %for.body.lr.ph

for.body.lr.ph:                                   ; preds = %entry
  %1 = load i64, ptr %d, align 8, !tbaa !5
  %2 = load i64, ptr %c, align 8, !tbaa !5
  %3 = load i64, ptr %b, align 8, !tbaa !5
  %4 = load i64, ptr %a, align 8, !tbaa !5
  %sub10 = sub nsw i64 %3, %4
  br label %for.body

for.body:                                         ; preds = %for.body.lr.ph, %for.inc
  %i.032 = phi i64 [ 0, %for.body.lr.ph ], [ %.neg, %for.inc ]
  %.neg = add nuw i64 %i.032, 1
  %sub1.neg = sub i64 %.neg, %0
  %mul = mul nsw i64 %1, %sub1.neg
  %mul3 = mul nsw i64 %2, %i.032
  %add = add nsw i64 %mul3, %mul
  %cmp11.not = icmp sgt i64 %add, %sub10
  br i1 %cmp11.not, label %for.inc, label %land.lhs.true

land.lhs.true:                                    ; preds = %for.body
  %mul7 = mul nsw i64 %2, %sub1.neg
  %mul8 = mul nsw i64 %1, %i.032
  %add9 = add nsw i64 %mul7, %mul8
  %cmp13.not = icmp sgt i64 %sub10, %add9
  br i1 %cmp13.not, label %for.inc, label %cleanup19

for.inc:                                          ; preds = %land.lhs.true, %for.body
  %cmp.not = icmp sgt i64 %.neg, %0
  br i1 %cmp.not, label %cleanup19, label %for.body

cleanup19:                                        ; preds = %for.inc, %land.lhs.true, %entry
  %.str.1.sink = phi ptr [ @.str.2, %entry ], [ @.str.1, %land.lhs.true ], [ @.str.2, %for.inc ]
  %call14 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
  ret i32 0
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.linker.options = !{}
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
