Some dwarves that are finishing the StUDY (State University for Dwarven Youngsters) Bachelor courses, have been told "no genome, no degree". That means that all dwarves should write a thesis on genome. Dwarven genome is far from simple. It is represented by a string that consists of lowercase Latin letters.

Dwarf Misha has already chosen the subject for his thesis: determining by two dwarven genomes, whether they belong to the same race. Two dwarves belong to the same race if we can swap two characters in the first dwarf's genome and get the second dwarf's genome as a result. Help Dwarf Misha and find out whether two gnomes belong to the same race or not.

Input

The first line contains the first dwarf's genome: a non-empty string, consisting of lowercase Latin letters.

The second line contains the second dwarf's genome: a non-empty string, consisting of lowercase Latin letters.

The number of letters in each genome doesn't exceed 105. It is guaranteed that the strings that correspond to the genomes are different. The given genomes may have different length.

Output

Print "YES", if the dwarves belong to the same race. Otherwise, print "NO".

Examples

Input

ab
ba


Output

YES


Input

aa
ab


Output

NO

Note

  * First example: you can simply swap two letters in string "ab". So we get "ba". 
  * Second example: we can't change string "aa" into string "ab", because "aa" does not contain letter "b". 
#include <bits/stdc++.h>
long long dx[4] = {-1, 0, 1, 0};
long long dy[4] = {0, -1, 0, 1};
long long mod = 1e9 + 7;
long long inf = INT_MAX;
bool vis[100000];
using namespace std;
bool isPrime(long long n) {
  long long j;
  for (j = 2; j <= sqrt(n); j++) {
    if (n % j == 0) {
      break;
    }
  }
  if (j > sqrt(n)) {
    return 1;
  } else {
    return 0;
  }
}
long long modexpo(long long a, long long b) {
  long long ans = 1;
  a = a % mod;
  while (b > 0) {
    if ((b & 1) == 1) {
      ans = ((ans % mod) * (a % mod)) % mod;
    }
    b = b >> 1;
    a = ((a % mod) * (a % mod)) % mod;
  }
  return ans;
}
long long invmod(long long n) { return modexpo(n, mod - 2); }
long long comb(long long n, long long r) {
  if (r == 0) {
    return 1;
  }
  long long fact[n + 1];
  fact[0] = 1;
  for (long long i = 1; i <= n; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
  }
  return (fact[n] * invmod(fact[r]) % mod * invmod(fact[n - r]) % mod) % mod;
}
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  }
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) {
  return ((a / gcd(a, b)) * (b / gcd(a, b))) * gcd(a, b);
}
bool sortbysecdesc(const pair<long long, long long> &a,
                   const pair<long long, long long> &b) {
  return a.second > b.second;
}
bool prime[1000005];
void sieve(int n) {
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
}
void dfs(long long i, vector<long long> adj[], bool visited[]) {
  visited[i] = 1;
  for (auto j : adj[i]) {
    if (visited[j] == 0) {
      dfs(j, adj, visited);
    }
  }
}
void solve(long long k) {
  string a;
  string b;
  cin >> a;
  cin >> b;
  if (a.size() != b.size()) {
    cout << "NO"
         << "\n";
    return;
  }
  long long c = 0, d, e;
  for (long long i = 0; i < a.size(); i++) {
    if (a[i] != b[i]) {
      c++;
      if (c > 1) {
        e = i;
      } else {
        d = i;
      }
    }
  }
  if (c != 2) {
    cout << "NO"
         << "\n";
    return;
  }
  if (a[d] != b[e] || a[e] != b[d]) {
    cout << "NO"
         << "\n";
    return;
  }
  cout << "YES"
       << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  long long k = 1;
  while (k <= t) {
    solve(k);
    k++;
  }
  return 0;
}
