-- Question B

import Control.Applicative
import Control.Monad

main = do
  [n,a,b,c,d] <- (map read . words) <$> getLine 
  putStrLn $ if c<d then check n a b c d else check n a b d c

check :: Int -> Int -> Int -> Int -> Int -> String
check n a b c d 
 | (elem b ([ a+x | k <- [1..(n-2)] , x <- ([(-n*d)..(-n*c)]++[(k*c-(n-k)*d)..(k*d-(n-k)*c)]++[(n*c)..(n*d)])  ])) ==True = "YES"
 | otherwise = "NO"
 