{"raw_statement":[{"iden":"statement","content":"Ayoub is a basketball coach where he has $n$ students, he told Kilani that the minimum height between his students is equal to $a$, and the maximum height between his students is equal to $b$, and the sum of heights of his students is equal to $s$.\n\nKilani thinks that the description that Ayoub gave him is wrong, and it is impossible to have such students with that description.\n\nKilani is not sure about that, so he asked you for help.\n\nGiven 4 integer numbers $n, a, b, s$, you should tell him if Ayoub's description is wrong for sure, or if it is possible to have $n$ students with that description.\n\nThe input will contain 4 integers $n, a, b, s$ $(1 <= n <= 100)$ $(1 <= a <= b <= 250)$ , $(1 <= s <= 25000)$.\n\nIf it is possible to have $n$ students with that description print \"YES\" . \n\nOtherwise print \"NO\".\n\n"},{"iden":"input","content":"The input will contain 4 integers $n, a, b, s$ $(1 <= n <= 100)$ $(1 <= a <= b <= 250)$ , $(1 <= s <= 25000)$."},{"iden":"output","content":"If it is possible to have $n$ students with that description print \"YES\" . Otherwise print \"NO\"."},{"iden":"examples","content":"Input5 2 4 13\nOutputYES\nInput5 2 3 30\nOutputNO\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of students.  \nLet $ a, b, s \\in \\mathbb{Z}^+ $ be the minimum height, maximum height, and total sum of heights, respectively.  \n\n**Constraints**  \n1. $ 1 \\leq n \\leq 100 $  \n2. $ 1 \\leq a \\leq b \\leq 250 $  \n3. $ 1 \\leq s \\leq 25000 $  \n\n**Objective**  \nDetermine whether there exists a multiset $ H = \\{h_1, h_2, \\dots, h_n\\} $ of $ n $ positive integers such that:  \n- $ \\min(H) = a $,  \n- $ \\max(H) = b $,  \n- $ \\sum_{i=1}^n h_i = s $.  \n\nEquivalently, determine if:  \n$$\nn \\cdot a \\leq s \\leq n \\cdot b\n$$  \nand  \n$$\ns \\geq a + b + (n - 2) \\cdot a \\quad \\text{(at least one } b \\text{ and the rest } \\geq a\\text{)}  \n$$  \nand  \n$$\ns \\leq a + b + (n - 2) \\cdot b \\quad \\text{(at least one } a \\text{ and the rest } \\leq b\\text{)}  \n$$  \n\nSimplified necessary and sufficient condition:  \n$$\na + b + (n - 2) \\cdot a \\leq s \\leq a + b + (n - 2) \\cdot b\n$$  \ni.e.,  \n$$\na(n - 1) + b \\leq s \\leq a + b(n - 1)\n$$","simple_statement":"Given n, a, b, s: can you have n students where the shortest is a, the tallest is b, and the total height is s? Print \"YES\" if possible, \"NO\" otherwise.","has_page_source":false}