#include <bits/stdc++.h>
using namespace std;
long long int pow_mod(long long int a, long long int b) {
  long long int res = 1;
  while (b != 0) {
    if (b & 1) {
      res = (res * a) % 1000000007;
    }
    a = (a * a) % 1000000007;
    b /= 2;
  }
  return res;
}
void solve() {
  string s;
  cin >> s;
  map<char, long long int> mp;
  for (long long int i = 0; i < (long long int)s.size(); i++) mp[s[i]]++;
  if (mp.size() > 4 || mp.size() == 1 || s.size() < 4)
    cout << "No\n";
  else if (mp.size() == 2) {
    auto it = mp.begin();
    if (it->second == 1)
      cout << "No\n";
    else {
      it++;
      if (it->second == 1)
        cout << "No\n";
      else
        cout << "Yes\n";
    }
  } else
    cout << "Yes\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  while (t--) solve();
  return 0;
}
