# HONEY LOVES MONEY Solutions BVPCSI04

Page Contents

### HONEY LOVES MONEY Solutions BVPCSI04

Nectar adores cash. He found a plan that can clone gold coins. Nectar realizes that on the off chance that he applies the plan to a unique gold coin, he moreover gets one more unique gold coin and one imitation, and on the off chance that he applies the plan to a reproduction gold coin, he gets two extra copies.

At first, Honey has just a single unique gold coin. He needs to know whether it is conceivable to utilize this plan to get precisely x copy gold coins and y unique gold coins? He can’t discard gold coins, and he can’t make a difference the plan to an imitation in the event that he doesn’t right now have any copies.

Information

The main line contains two whole numbers x and y — the quantity of duplicates and the quantity of unique gold coins Imp needs to get (counting the underlying one).

Yield

Print “Yes”, if the ideal arrangement is conceivable, and “No” something else.

Requirements

(0 ≤ x, y ≤ 109)

Test input

6 3

Test yield

Indeed

Test input

4 2

Test yield

No

Test input

1000 1001

Test yield

Indeed

Clarification

In the primary model, Imp needs to apply the machine twice to unique toys and afterward twice to duplicates.

CODE C++14 :

#include <iostream>
using namespace std;

int main(){
long int x, y;
cin >> x >> y;
if(y==0){
cout << “No” << endl;
}
else if(y==1){
if(x==0)
cout << “Yes” << endl;
else
cout << “No” << endl;
}
else if(x<y){
if(x-y==-1)
cout << “Yes” << endl;
else
cout << “No” << endl;
}
else{
if(y%2==0){
if(x%2!=0)
cout << “Yes” << endl;
else
cout << “No” << endl;
}
else{
if(x%2==0)
cout << “Yes” << endl;
else
cout << “No” << endl;
}
}
return 0;
}