codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

92101.md (1403B)


      1 Source: https://codeforces.com/problemset/problem/9210/1
      2 
      3 A. Cloning Toys
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 Imp likes his plush toy a lot.
     22 
     23  ![](https://espresso.codeforces.com/a5df87d0239cb116c7d665f512106966ac6928fc.png) 
     24 
     25 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.
     26 
     27 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.
     28 
     29 Input
     30 
     31 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).
     32 
     33 Output
     34 
     35 Print "Yes", if the desired configuration is possible, and "No" otherwise.
     36 
     37 You can print each letter in arbitrary case (upper or lower).
     38 
     39 Examples
     40 
     41 Input
     42 
     43 ```
     44 6 3
     45 ```
     46 
     47 Output
     48 
     49 ```
     50 Yes
     51 ```
     52 
     53 Input
     54 
     55 ```
     56 4 2
     57 ```
     58 
     59 Output
     60 
     61 ```
     62 No
     63 ```
     64 
     65 Input
     66 
     67 ```
     68 1000 1001
     69 ```
     70 
     71 Output
     72 
     73 ```
     74 Yes
     75 ```
     76 
     77 Note
     78 
     79 In the first example, Imp has to apply the machine twice to original toys and then twice to copies.