407684: GYM102873 D Sanda's Job

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Sanda's Jobtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Sanda's father has a number $$$a$$$.

One day her father wanted to obtain another number $$$s$$$ and asked Sanda for help.

But Sanda only knows one operation, she can rearrange the digits of a given number $$$a$$$ (she can't construct a number with leading zeroes).

Sanda now wants to know if she can write the desired number $$$s$$$ as the sum of the father's original number $$$a$$$ and a rearrangement of it (the rearrangement can be equal to the original number).

In other words, you have to check if there exists a number $$$b$$$ which is obtained by reordering the digits from the initial number $$$a$$$ such that $$$a + b = s$$$.

Help Sanda determine if she can be successful, print "YES" if she can do the job, else print "NO".

Input

The first (and only) line contains positive integers $$$a$$$ and $$$s$$$ $$$(1 \leq a, s \leq 10^{15})$$$.

Output

Print "YES" if she can do the job, else print "NO".

ExamplesInput
1000 1001
Output
NO
Input
123 255
Output
YES
Input
100 200
Output
YES
Note

In the first sample, it is impossible to find any permutation that fits the requirement.

In the second sample, a possible permutation of digits of the number $$$123$$$ is $$$132$$$ Adding them up together we obtain $$$255$$$ - the required sum, so there exists at least a solution

加入题单

算法标签: