logo AlgoBeat OnlineJudge
登录 注册

#215718. [ICPC 2025 Jakarta R] AND and/or OR

内存限制:2048 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Suppose you have a non-negative integer . You can do two types of operations:

  • ;
  • ;

where and are the bitwise AND and bitwise OR operations, respectively.

You are given three integers , , and .

If the value of is initially , is there any sequence of operations that consists of operations of type 1 and operations of type 2, such that the final value of is for some non-negative integer ?

输入格式

Input consists of three integers , , and (, , ).

输出格式

Output a single line containing if it is possible to make the final value of equal to where is a non-negative integer, or otherwise.

样例

样例输入 1

14 2 2

样例输出 1

YES

样例输入 2

1 0 9

样例输出 2

NO

数据范围与提示

Initially, . You can do the following sequence of operations:

  • Do a type 1 operation. .
  • Do a type 1 operation. .
  • Do a type 2 operation. .
  • Do a type 2 operation. .

The final value of is .