A. Cloning Toys

time limit per test 1 second

memory limit per test 256 megabytes

Problem Description

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.


解题心得:

  1. 比赛的时候差点被这个题的题意给绕进去,看了好久,其实这个题的意思是,

    • 你将一个原版的物品放入copy机,可以多得到一个原版的物品,多得到一个复制的物品。
    • 如果把复制的物品放入copy机,可以多得到两个复制的物品。
  2. 判定是否可以出现x个复制物品,y个原版的物品就很简单了。x-y+1必须是一个偶数,x-y+1必须大于等于零,y必须大于1(不能丢弃),y等于1的时候x必须等于0。判断不完全可能被hack。

#include <bits/stdc++.h>
using namespace std;
const int maxn = 10;
int main(){
int a,b;
scanf("%d%d",&a,&b);
if((b == 1 && a != 0) || b == 0){
printf("No\n");
return 0;
}
int c = a-b+1;
if(c%2 || c < 0)
printf("No\n");
else
printf("Yes\n");
return 0;
}

最新文章

  1. 判断js引擎是javascriptCore或者v8
  2. 安卓Android科大讯飞语音识别代码使用详解
  3. TinyMCE添加图片 路径自动处理成相对路径
  4. MEF load plugin from directory
  5. linux 文件比对总结
  6. secureCRT常用设置
  7. 织梦DedeCMS广告管理模块增加图片上传功能插件
  8. 大型分布式C++框架《三:序列化与反序列化》
  9. C语言之三大查找算法
  10. Chapter 1 First Sight——1
  11. MyBatis --- 动态SQL、缓存机制
  12. java网络编程(3)——UDP
  13. 【Swing程序设计/常用面板】
  14. #考研笔记#计算机之word问题
  15. Sequential Container
  16. Python基础【day03】:集合入门(三)
  17. [IR] Arithmetic Coding
  18. STL——set
  19. Gym - 101806T: Touch The Sky(贪心)
  20. 【git】之使用eclipse-git插件查看本地文件和远程文件区别

热门文章

  1. c#写word文档基础操作(自己控制样式)
  2. c#读取word内容,c#提取word内容
  3. [Java][Liferay] 解决Liferay ext项目deploy的问题
  4. 【解决】Git failed with a fatal error. Authentication failed for ‘http://......’
  5. jQuery开发插件的两个方法 js 深浅拷贝
  6. Day5 CSS基本样式和C3选择器
  7. leetcode85 Maximal Rectangle
  8. python小游戏之贪吃蛇
  9. 企业常用的站内收索、QQ群、在线客服
  10. cms-首页搭建