#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  int fre[26] = {}, n = s.size();
  set<int> st;
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    st.insert(s[i] - 'a');
    fre[s[i] - 'a']++;
  }
  if (st.size() == 4) {
    cout << "Yes";
    return 0;
  }
  auto it = st.begin();
  if ((st.size() > 4 or st.size() == 1) or
      (st.size() == 2 and (fre[*it] == 1 or fre[*(++it)] == 1))) {
    cout << "No";
    return 0;
  }
  it = st.begin();
  if (st.size() == 3) {
    int a = *it;
    int b = *(++it);
    int c = *(++it);
    if (fre[a] == 1 and fre[b] == 1 and fre[c] == 1) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
}
