

Time Limit: 2 sec / Memory Limit: 1024 MiB
配点 : 100 点
問題文
高橋君はたこ焼きを作ってすぬけ君に振る舞うことにしました。高橋君はすぬけ君に、たこ焼きを食べたいならば左手のみを挙げて、そうでないならば右手のみを挙げるよう指示しました。
すぬけ君が挙げた手の情報は整数 L, R によって与えられます。 すぬけ君は L = 1 のとき、またそのときに限り左手を挙げており、R = 1 のとき、またそのときに限り右手を挙げています。すぬけ君は指示に従わず、両手を挙げることも手を挙げないこともあります。
すぬけ君が片方の手のみを挙げている場合、すぬけ君がたこ焼きを食べたいならば Yes
を、そうでないならば No
を出力してください。すぬけ君が両手を挙げているか、手を挙げていないときは Invalid
と出力してください。
ただし、すぬけ君が片方の手のみを挙げている場合は必ず指示に従った行動を取っているものとします。
制約
- L, R は 0 または 1
入力
入力は以下の形式で標準入力から与えられる。
L R
出力
問題文の指示に従って Yes
, No
, Invalid
のいずれかを出力せよ。
入力例 1
1 0
出力例 1
Yes
すぬけ君はたこ焼きを食べたいので左手のみを挙げています。
入力例 2
1 1
出力例 2
Invalid
すぬけ君は両手を挙げています。
Score : 100 points
Problem Statement
Takahashi decided to make takoyaki (octopus balls) and serve it to Snuke. Takahashi instructed Snuke to raise only his left hand if he wants to eat takoyaki, and only his right hand otherwise.
You are given the information about which hand Snuke is raising as two integers L and R. He is raising his left hand if and only if L = 1, and raising his right hand if and only if R = 1. He might not follow the instructions and could raise both hands or not raise any hand at all.
If Snuke is raising only one hand, print Yes
if he wants to eat takoyaki, and No
if he does not. If he is raising both hands or not raising any hand, print Invalid
.
Assume that if Snuke is raising only one hand, he is always following the instructions.
Constraints
- Each of L and R is 0 or 1.
Input
The input is given from Standard Input in the following format:
L R
Output
Print Yes
, No
, or Invalid
according to the instructions in the problem statement.
Sample Input 1
1 0
Sample Output 1
Yes
Snuke wants to eat takoyaki, so he is raising only his left hand.
Sample Input 2
1 1
Sample Output 2
Invalid
Snuke is raising both hands.