A. Cloning Toys
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

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.

Input

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).

Output

Print "Yes", if the desired configuration is possible, and "No" otherwise.

You can print each letter in arbitrary case (upper or lower).

Examples
input
6 3
output
Yes
input
4 2
output
No
input
1000 1001
output
Yes
Note

In the first example, Imp has to apply the machine twice to original toys and then twice to copies.

有两种玩具,这里假设成A、B两种玩具,A玩具可以再产生一个A玩具和一个B玩具,B玩具可以再产生两个B玩具。现在我们有一个A玩具,问最后是否能得到X个B玩具,Y个A玩具。能得到输出Yes,不能得到输出No。

#include<map>
#include<queue>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define maxn 100010
#define debug(a) cout << #a << " " << a << endl
using namespace std;
typedef long long ll;
int main() {
int n,m;
while( cin >> n >> m ) {
if( n == && m == ) {
cout << "Yes" << endl;
continue;
}
if( n == || m == || m == ) {
cout << "No" << endl;
continue;
}
if( ( n - m + ) % == && ( n - m + ) >= ) {
cout << "Yes" << endl; //注意负的偶数余2也等于0,这里要特判下,因为没有考虑到这种情况WA两次。。。
} else {
cout << "No" << endl;
}
}
return ;
}

最新文章

  1. 运动规划 (Motion Planning): MoveIt! 与 OMPL
  2. C语言处理xml文件的库
  3. treap树---Double Queue
  4. python中的面向对象编程
  5. QML学习笔记之二
  6. COJ 1011 WZJ的数据结构(十一)树上k大
  7. 12c meet sysdba meet ORA-01017: invalid username/password; logon denied
  8. 如何用好消息推送(JPush)为app拉新、留存、促活
  9. HIT2019春软件构造-&gt;正则表达式语法
  10. 2-2:python之控制结构
  11. JUnit 4.0学习笔记
  12. boost serialize序列化
  13. 使用 Edit + MASM 5.0 编译器 + Linker 连接器
  14. BZOJ 2002: [Hnoi2010]Bounce 弹飞绵羊 lct 动态树 splay
  15. Qt UI界面改了,但UI界面不更新
  16. COCO2018 stuff分割
  17. 当app出现线上奔溃,该如何办?
  18. [转]C++ Template
  19. chapter07
  20. miller_rabin + pollard_rho模版

热门文章

  1. 图片验证码+session
  2. 对于HTTP过程中POST内容加密的解决方案
  3. 新IT运维时代 | Docker运维之最佳实践-下篇
  4. Maven多模块项目打包前的一些注意事项(打包失败)
  5. -bash: redis: command not found
  6. python2.7官方文档阅读笔记
  7. Python入门基础(10)_异常_1
  8. MySQL-InnoDB锁(二)
  9. Mybatis框架(9)---Mybatis自定义插件生成雪花ID做为表主键项目
  10. Linux查找命令对比(find、locate、whereis、which、type、grep)