CF922A.Cloning Toys
普及-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Imp likes his plush toy a lot.

Recently, he found a machine that can clone plush toys. Imp knows that if he applies the machine to an original toy, he additionally gets one more original toy and one copy, and if he applies the machine to a copied toy, he gets two additional copies.
Initially, Imp has only one original toy. He wants to know if it is possible to use machine to get exactly x copied toys and y original toys? He can't throw toys away, and he can't apply the machine to a copy if he doesn't currently have any copies.
Imp 非常喜欢他的毛绒玩具。

最近,他发现了一台可以克隆毛绒玩具的机器。Imp 知道:若将该机器作用于一个原始玩具,则会额外获得一个原始玩具和一个复制品;若将该机器作用于一个复制品,则会额外获得两个复制品。
初始时,Imp 仅拥有一个原始玩具。他想知道:是否可能通过使用这台机器,恰好得到 x 个复制品和 y 个原始玩具?他不能丢弃任何玩具,且只有当当前至少拥有一个复制品时,才能将机器作用于一个复制品。
输入格式
The only line contains two integers x and y (0 ≤ x, y ≤ 109) — the number of copies and the number of original toys Imp wants to get (including the initial one).
唯一的一行包含两个整数 x 和 y(0 ≤ x,y ≤ 109)—— 分别表示 Imp 想要获得的复制品数量和原始玩具数量(包括初始的那个)。
输出格式
Print "Yes", if the desired configuration is possible, and "No" otherwise.
You can print each letter in arbitrary case (upper or lower).
如果可以达到目标配置,则输出“Yes”;否则输出“No”。
每个字母可以以任意大小写(大写或小写)输出。
输入输出样例
输入#1
6 3
输出#1
Yes
输入#2
4 2
输出#2
No
输入#3
1000 1001
输出#3
Yes
说明/提示
In the first example, Imp has to apply the machine twice to original toys and then twice to copies.
在第一个例子中,Imp 需要对原始玩具应用该机器两次,然后对生成的复制品再应用两次。
输入解题思路,AI测评打分。不知道怎么写?