#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
long long fac[1000006];
inline long long exp(long long x, long long n) {
  long long r = 1;
  x = x;
  while (n) {
    if (n % 2) r = (r * x);
    x = (x * x);
    n = n / 2;
  }
  return r;
}
inline long long mmi(long long a) {
  return exp(a, 1000000007 - 2) % 1000000007;
}
inline long long fact(long long n) {
  long long res = 1;
  for (long long i = 1; i < (n + 1); ++i) {
    res = (res * i) % 1000000007;
  }
  return res;
}
inline void fact_a() {
  fac[0] = 1;
  fac[1] = 1;
  for (long long i = 1; i < (105); ++i) {
    fac[i] = (fac[i - 1] * i) % 1000000007;
  }
}
inline long long inv_fact(long long n) {
  long long par = fac[n];
  long long res = mmi(par);
  return res;
}
inline long long comb(long long n, long long r) {
  if (n == r && r == 0) return 1;
  if (n < r) return 0;
  return ((fac[n] * inv_fact(r)) % 1000000007 * inv_fact(n - r)) % 1000000007;
}
struct triplet {
  long long a, b, c;
};
bool operator<(const triplet &t1, const triplet &t2) {
  if (t1.a < t2.a) return true;
  if (t1.a == t2.a && t1.b < t2.b) return true;
  if (t1.a == t2.a && t1.b == t2.b && t1.c < t2.c) return true;
  return false;
}
pair<long long, pair<long long, long long> > ex_gcd(long long a, long long b) {
  if (b == 0) {
    return make_pair(a, make_pair(1, 0));
  }
  pair<long long, pair<long long, long long> > p = ex_gcd(b, a % b);
  long long gcd = p.first;
  long long x1 = p.second.first;
  long long y1 = p.second.second;
  long long x = y1;
  long long y = x1 - (a / b) * y1;
  return make_pair(gcd, make_pair(x, y));
}
long long prime[3000006];
long long spf_prime[3000006];
void sieve() {
  prime[1] = 1;
  for (long long i = 2; i * i <= 3000000; i++)
    if (prime[i] == 0)
      for (long long j = i * i; j <= 3000000; j += i) prime[j] = 1;
}
void spf() {
  for (long long i = 2; i * i <= 3000000; i++)
    if (!spf_prime[i])
      for (long long j = i * i; j <= 3000000; j += i)
        if (!spf_prime[j]) spf_prime[j] = i;
  for (long long i = 2; i <= 3000000; i++)
    if (!spf_prime[i]) spf_prime[i] = i;
}
long long getparent_BIT(long long idx) { return idx - (idx & -idx); }
long long getnext_BIT(long long idx) { return idx + (idx & -idx); }
long long getsum_BIT(long long idx, long long BIT[], long long n) {
  long long sum = 0;
  while (idx > 0) {
    sum += BIT[idx];
    idx = getparent_BIT(idx);
  }
  return sum;
}
void update_BIT(long long idx, long long BIT[], long long val, long long n) {
  while (idx <= n) {
    BIT[idx] += val;
    idx = getnext_BIT(idx);
  }
}
void build_BIT(long long BIT[], long long a[], long long n) {
  for (long long i = 0; i < (n); ++i) {
    update_BIT(i, BIT, a[i], n);
  }
}
void comp_lps(string s, long long lps[], long long n) {
  long long i = 1, j = 0;
  while (i < n) {
    if (s[i] == s[j]) {
      lps[i++] = ++j;
    } else {
      if (j != 0)
        j = lps[j - 1];
      else
        lps[i++] = 0;
    }
  }
}
void dfs_l(long long u, vector<vector<long long> > &adj, long long status[]) {
  if (status[u] == 1) return;
  status[u] = 1;
  for (long long i = 0; i < (adj[u].size()); ++i) dfs_l(adj[u][i], adj, status);
}
long long dij(long long u, long long n,
              vector<vector<pair<long long, long long> > > &adj,
              long long status[]) {
  long long dist[n];
  for (long long i = 0; i < (n); ++i) dist[i] = 1000000000;
  dist[0] = 0;
  priority_queue<pair<long long, long long>,
                 vector<pair<long long, long long> >,
                 greater<pair<long long, long long> > >
      q;
  q.push(make_pair(0, 0));
  while (!q.empty()) {
    pair<long long, long long> p;
    p = q.top();
    q.pop();
    long long x = p.second;
    long long w = p.first;
    if (status[x] == 1) continue;
    status[x] = 1;
    for (long long i = 0; i < (adj[x].size()); ++i) {
      long long ww = adj[x][i].first;
      long long y = adj[x][i].second;
      if (dist[x] + ww < dist[y]) {
        dist[y] = dist[x] + ww;
        q.push(make_pair(dist[y], y));
      }
    }
  }
  if (dist[n - 1] >= 1000000000) return -1;
  return dist[n - 1];
}
long long phi(long long n) {
  vector<long long> v;
  long long k = n;
  ;
  for (long long i = 2; i * i <= n; i++) {
    if (k % i == 0) {
      v.push_back(i);
      while (k % i == 0) k /= i;
    }
  }
  if (k > 1) v.push_back(k);
  long long ans = n;
  for (long long i = 0; i < (v.size()); ++i) ans -= (ans / v[i]);
  return ans;
}
struct trie {
  struct trie *left, *right;
  bool isend;
};
trie *get_trie() {
  trie *ptr = new trie;
  ptr->left = NULL;
  ptr->right = NULL;
  ptr->isend = false;
  return ptr;
}
bool isempty(trie *root) {
  if (root->left == NULL && root->right == NULL) return true;
  return false;
}
void insert_trie(trie *root, string key) {
  trie *ptr = root;
  for (long long i = 0; i < (key.size()); ++i) {
    if (key[i] == '0') {
      if (ptr->left == NULL) {
        ptr->left = get_trie();
      }
      ptr = ptr->left;
    } else {
      if (ptr->right == NULL) ptr->right = get_trie();
      ptr = ptr->right;
    }
  }
  ptr->isend = true;
}
trie *remove_trie(trie *root, string key, long long idx = 0) {
  if (root == NULL) return NULL;
  if (idx == key.size()) {
    if (isempty(root)) {
      delete (root);
      root = NULL;
    }
    return root;
  }
  if (key[idx] == '0')
    root->left = remove_trie(root->left, key, idx + 1);
  else
    root->right = remove_trie(root->right, key, idx + 1);
  if (isempty(root)) {
    delete (root);
    root = NULL;
  }
  return root;
}
long long search_trie(trie *root, string key) {
  trie *ptr = root;
  string s = "";
  for (long long i = 0; i < (key.size()); ++i) {
    if (key[i] == '0') {
      if (ptr->right != NULL) {
        ptr = ptr->right;
        s += '1';
      } else {
        ptr = ptr->left;
        s += '0';
      }
    } else {
      if (ptr->left != NULL) {
        ptr = ptr->left;
        s += '1';
      } else {
        ptr = ptr->right;
        s += '0';
      }
    }
  }
  long long res = 0;
  reverse(s.begin(), s.end());
  for (long long i = s.length() - 1; i >= (0); --i)
    res = res * 2 + (s[i] - '0');
  return res;
}
struct Comp {
  bool operator()(const std::pair<int, int> &a, const std::pair<int, int> &b) {
    if (a.first != b.first) {
      return a.first < b.first;
    }
    return a.second > b.second;
  }
};
void dearr() {
  long long dar[1005];
  dar[0] = 1;
  dar[1] = 0;
  dar[2] = 1;
  for (long long i = 3; i < (1002); ++i) {
    dar[i] = (i - 1) * (dar[i - 1] + dar[i - 2]);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s, r;
  cin >> s >> r;
  if (s.length() != r.length()) {
    cout << "NO"
         << "\n";
  } else {
    long long f = 0;
    long long ff = 0;
    for (long long i = 0; i < (s.length()); ++i)
      if (s[i] != '0') f = 1;
    for (long long i = 0; i < (r.length()); ++i)
      if (r[i] != '0') ff = 1;
    if (ff != f)
      cout << "NO"
           << "\n";
    else
      cout << "YES"
           << "\n";
  }
}

### Prompt

Generate a CPP solution to the following problem:

The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.

A Bitlandish string is a string made only of characters "0" and "1".

BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish string a, and applies several (possibly zero) operations to it. In one operation the mayor may take any two adjacent characters of a string, define one of them as x and the other one as y. Then he calculates two values p and q: p = x xor y, q = x or y. Then he replaces one of the two taken characters by p and the other one by q.

The xor operation means the bitwise excluding OR operation. The or operation is the bitwise OR operation.

So for example one operation can transform string 11 to string 10 or to string 01. String 1 cannot be transformed into any other string.

You've got two Bitlandish strings a and b. Your task is to check if it is possible for BitHaval to transform string a to string b in several (possibly zero) described operations.

Input

The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths.

It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106.

Output

Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes.

Examples

Input

11
10


Output

YES


Input

1
01


Output

NO


Input

000
101


Output

NO

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
long long fac[1000006];
inline long long exp(long long x, long long n) {
  long long r = 1;
  x = x;
  while (n) {
    if (n % 2) r = (r * x);
    x = (x * x);
    n = n / 2;
  }
  return r;
}
inline long long mmi(long long a) {
  return exp(a, 1000000007 - 2) % 1000000007;
}
inline long long fact(long long n) {
  long long res = 1;
  for (long long i = 1; i < (n + 1); ++i) {
    res = (res * i) % 1000000007;
  }
  return res;
}
inline void fact_a() {
  fac[0] = 1;
  fac[1] = 1;
  for (long long i = 1; i < (105); ++i) {
    fac[i] = (fac[i - 1] * i) % 1000000007;
  }
}
inline long long inv_fact(long long n) {
  long long par = fac[n];
  long long res = mmi(par);
  return res;
}
inline long long comb(long long n, long long r) {
  if (n == r && r == 0) return 1;
  if (n < r) return 0;
  return ((fac[n] * inv_fact(r)) % 1000000007 * inv_fact(n - r)) % 1000000007;
}
struct triplet {
  long long a, b, c;
};
bool operator<(const triplet &t1, const triplet &t2) {
  if (t1.a < t2.a) return true;
  if (t1.a == t2.a && t1.b < t2.b) return true;
  if (t1.a == t2.a && t1.b == t2.b && t1.c < t2.c) return true;
  return false;
}
pair<long long, pair<long long, long long> > ex_gcd(long long a, long long b) {
  if (b == 0) {
    return make_pair(a, make_pair(1, 0));
  }
  pair<long long, pair<long long, long long> > p = ex_gcd(b, a % b);
  long long gcd = p.first;
  long long x1 = p.second.first;
  long long y1 = p.second.second;
  long long x = y1;
  long long y = x1 - (a / b) * y1;
  return make_pair(gcd, make_pair(x, y));
}
long long prime[3000006];
long long spf_prime[3000006];
void sieve() {
  prime[1] = 1;
  for (long long i = 2; i * i <= 3000000; i++)
    if (prime[i] == 0)
      for (long long j = i * i; j <= 3000000; j += i) prime[j] = 1;
}
void spf() {
  for (long long i = 2; i * i <= 3000000; i++)
    if (!spf_prime[i])
      for (long long j = i * i; j <= 3000000; j += i)
        if (!spf_prime[j]) spf_prime[j] = i;
  for (long long i = 2; i <= 3000000; i++)
    if (!spf_prime[i]) spf_prime[i] = i;
}
long long getparent_BIT(long long idx) { return idx - (idx & -idx); }
long long getnext_BIT(long long idx) { return idx + (idx & -idx); }
long long getsum_BIT(long long idx, long long BIT[], long long n) {
  long long sum = 0;
  while (idx > 0) {
    sum += BIT[idx];
    idx = getparent_BIT(idx);
  }
  return sum;
}
void update_BIT(long long idx, long long BIT[], long long val, long long n) {
  while (idx <= n) {
    BIT[idx] += val;
    idx = getnext_BIT(idx);
  }
}
void build_BIT(long long BIT[], long long a[], long long n) {
  for (long long i = 0; i < (n); ++i) {
    update_BIT(i, BIT, a[i], n);
  }
}
void comp_lps(string s, long long lps[], long long n) {
  long long i = 1, j = 0;
  while (i < n) {
    if (s[i] == s[j]) {
      lps[i++] = ++j;
    } else {
      if (j != 0)
        j = lps[j - 1];
      else
        lps[i++] = 0;
    }
  }
}
void dfs_l(long long u, vector<vector<long long> > &adj, long long status[]) {
  if (status[u] == 1) return;
  status[u] = 1;
  for (long long i = 0; i < (adj[u].size()); ++i) dfs_l(adj[u][i], adj, status);
}
long long dij(long long u, long long n,
              vector<vector<pair<long long, long long> > > &adj,
              long long status[]) {
  long long dist[n];
  for (long long i = 0; i < (n); ++i) dist[i] = 1000000000;
  dist[0] = 0;
  priority_queue<pair<long long, long long>,
                 vector<pair<long long, long long> >,
                 greater<pair<long long, long long> > >
      q;
  q.push(make_pair(0, 0));
  while (!q.empty()) {
    pair<long long, long long> p;
    p = q.top();
    q.pop();
    long long x = p.second;
    long long w = p.first;
    if (status[x] == 1) continue;
    status[x] = 1;
    for (long long i = 0; i < (adj[x].size()); ++i) {
      long long ww = adj[x][i].first;
      long long y = adj[x][i].second;
      if (dist[x] + ww < dist[y]) {
        dist[y] = dist[x] + ww;
        q.push(make_pair(dist[y], y));
      }
    }
  }
  if (dist[n - 1] >= 1000000000) return -1;
  return dist[n - 1];
}
long long phi(long long n) {
  vector<long long> v;
  long long k = n;
  ;
  for (long long i = 2; i * i <= n; i++) {
    if (k % i == 0) {
      v.push_back(i);
      while (k % i == 0) k /= i;
    }
  }
  if (k > 1) v.push_back(k);
  long long ans = n;
  for (long long i = 0; i < (v.size()); ++i) ans -= (ans / v[i]);
  return ans;
}
struct trie {
  struct trie *left, *right;
  bool isend;
};
trie *get_trie() {
  trie *ptr = new trie;
  ptr->left = NULL;
  ptr->right = NULL;
  ptr->isend = false;
  return ptr;
}
bool isempty(trie *root) {
  if (root->left == NULL && root->right == NULL) return true;
  return false;
}
void insert_trie(trie *root, string key) {
  trie *ptr = root;
  for (long long i = 0; i < (key.size()); ++i) {
    if (key[i] == '0') {
      if (ptr->left == NULL) {
        ptr->left = get_trie();
      }
      ptr = ptr->left;
    } else {
      if (ptr->right == NULL) ptr->right = get_trie();
      ptr = ptr->right;
    }
  }
  ptr->isend = true;
}
trie *remove_trie(trie *root, string key, long long idx = 0) {
  if (root == NULL) return NULL;
  if (idx == key.size()) {
    if (isempty(root)) {
      delete (root);
      root = NULL;
    }
    return root;
  }
  if (key[idx] == '0')
    root->left = remove_trie(root->left, key, idx + 1);
  else
    root->right = remove_trie(root->right, key, idx + 1);
  if (isempty(root)) {
    delete (root);
    root = NULL;
  }
  return root;
}
long long search_trie(trie *root, string key) {
  trie *ptr = root;
  string s = "";
  for (long long i = 0; i < (key.size()); ++i) {
    if (key[i] == '0') {
      if (ptr->right != NULL) {
        ptr = ptr->right;
        s += '1';
      } else {
        ptr = ptr->left;
        s += '0';
      }
    } else {
      if (ptr->left != NULL) {
        ptr = ptr->left;
        s += '1';
      } else {
        ptr = ptr->right;
        s += '0';
      }
    }
  }
  long long res = 0;
  reverse(s.begin(), s.end());
  for (long long i = s.length() - 1; i >= (0); --i)
    res = res * 2 + (s[i] - '0');
  return res;
}
struct Comp {
  bool operator()(const std::pair<int, int> &a, const std::pair<int, int> &b) {
    if (a.first != b.first) {
      return a.first < b.first;
    }
    return a.second > b.second;
  }
};
void dearr() {
  long long dar[1005];
  dar[0] = 1;
  dar[1] = 0;
  dar[2] = 1;
  for (long long i = 3; i < (1002); ++i) {
    dar[i] = (i - 1) * (dar[i - 1] + dar[i - 2]);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s, r;
  cin >> s >> r;
  if (s.length() != r.length()) {
    cout << "NO"
         << "\n";
  } else {
    long long f = 0;
    long long ff = 0;
    for (long long i = 0; i < (s.length()); ++i)
      if (s[i] != '0') f = 1;
    for (long long i = 0; i < (r.length()); ++i)
      if (r[i] != '0') ff = 1;
    if (ff != f)
      cout << "NO"
           << "\n";
    else
      cout << "YES"
           << "\n";
  }
}

```