#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, ss;
  cin >> s >> ss;
  int n = min(s.length(), ss.length());
  int m = max(s.length(), ss.length());
  if (s.length() > ss.length()) {
    while (n-- && m--) {
      if ((s[m] == '0' && ss[n] != '0') || (ss[n] == '0' && s[m] != '0')) {
        return puts("NO"), 0;
      } else if (s[m] == '0' && ss[n] == s[m] &&
                 s[m + 1] - 48 + ss[n + 1] - 48 >= 10) {
        return puts("NO"), 0;
      } else if (s[m] - 48 + ss[n] - 48 == 10) {
        return puts("NO"), 0;
      } else if (s[m] - 48 + ss[n] - 48 == 9 &&
                 s[m + 1] - 48 + ss[n + 1] - 48 >= 10) {
        return puts("NO"), 0;
      }
    }
  } else {
    while (n-- && m--) {
      if ((s[n] == '0' && ss[m] != '0') || (ss[m] == '0' && s[n] != '0')) {
        return puts("NO"), 0;
      } else if (s[n] == '0' && ss[m] == s[n] &&
                 s[n + 1] - 48 + ss[m + 1] - 48 >= 10) {
        return puts("NO"), 0;
      } else if (s[n] - 48 + ss[m] - 48 == 10) {
        return puts("NO"), 0;
      } else if (s[n] - 48 + ss[m] - 48 == 9 &&
                 s[n + 1] - 48 + ss[m + 1] - 48 >= 10) {
        return puts("NO"), 0;
      }
    }
  }
  return puts("YES"), 0;
  return 0;
}
