#include <bits/stdc++.h>
using namespace std;
vector<int> vec;
int arr[35];
int main() {
  string s;
  cin >> s;
  map<char, int> mp;
  for (int i = 0; i < s.size(); i++) {
    mp[s[i]]++;
  }
  map<char, int>::iterator it = mp.begin();
  for (; it != mp.end(); it++) {
    arr[it->first - 'a'] = it->second;
  }
  for (int i = 0; i < 30; i++) {
    if (arr[i] != 0) {
      vec.push_back(arr[i]);
    }
  }
  if (s.size() < 4) {
    cout << "No";
    return 0;
  } else if (mp.size() == 2) {
    if (vec[0] == 1 || vec[1] == 1) {
      cout << "No";
    } else {
      cout << "Yes";
    }
  } else if (mp.size() == 1) {
    cout << "No";
  } else if (mp.size() > 4)
    cout << "No";
  else {
    cout << "Yes";
  }
  return 0;
}
