Question
Alice and Bob have 3 kinds of chocolates. There are A chocolates of the first type and B of the second type. Both Alice and
Alice and Bob have 3 kinds of chocolates. There are A chocolates of the first type and B of the second type. Both Alice and Bob love the third type of chocolate and want to have that one at any cost but being the most special and expensive they have only one of that type. To decide who gets the third kind of cholocate, Alice proposes the following rules: they will pick some cholocates of type 1 and 2 turn by turn. In each turn one of the following valid moves can be done:
• Pick some chocolates of type 1
• Pick some chocolates of type 2
• Pick equal number of chocolates of type 1 and 2
They have to pick at least one chocolate in each turn. Whoever makes the last move wins and gets the third type of chocolate. Both Alice and Bob are very smart and choose optimally. However while telling the rules of the competition, Alice cheated a bit to ensure that she wins the game by deciding wo will take the first move. Did Alice decide to go first?
Input
The input consists of a single line of 2 space-separated integers A and B. 0 ≤ A, B ≤ 100
Output
Output a single line containing "YES "if Alice decides to go first and "NO" otherwise.
Step by Step Solution
3.43 Rating (153 Votes )
There are 3 Steps involved in it
Step: 1
include ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started