CF75A.Life Without Zeros

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Can you imagine our life if we removed all zeros from it? For sure we will have many problems.

In this problem we will have a simple example if we removed all zeros from our life, it's the addition operation. Let's assume you are given this equation a+b=ca+b=c , where aa and bb are positive integers, and cc is the sum of aa and bb . Now let's remove all zeros from this equation. Will the equation remain correct after removing all zeros?

For example if the equation is 101+102=203101+102=203 , if we removed all zeros it will be 11+12=2311+12=23 which is still a correct equation.

But if the equation is 105+106=211105+106=211 , if we removed all zeros it will be 15+16=21115+16=211 which is not a correct equation.

输入格式

The input will consist of two lines, the first line will contain the integer aa , and the second line will contain the integer bb which are in the equation as described above ( 1<=a,b<=1091<=a,b<=10^{9} ). There won't be any leading zeros in both. The value of cc should be calculated as c=a+bc=a+b .

输出格式

The output will be just one line, you should print "YES" if the equation will remain correct after removing all zeros, and print "NO" otherwise.

输入输出样例

  • 输入#1

    101
    102
    

    输出#1

    YES
    
  • 输入#2

    105
    106
    

    输出#2

    NO
    
首页