#include <bits/stdc++.h>
using namespace std;
string s;
map<char, int> m;
int main() {
  cin >> s;
  for (int i = 0, len = s.length(); i < len; ++i) {
    if (m[s[i]] == 0)
      m[s[i]] = 1;
    else
      m[s[i]]++;
    if (m.size() > 4) return !printf("No\n");
  }
  if (m.size() < 2)
    return !printf("No\n");
  else if (m.size() == 2) {
    map<char, int>::iterator it = m.begin();
    if (it->second < 2 || (++it)->second < 2)
      return !printf("No\n");
    else
      return !printf("Yes\n");
  } else if (m.size() == 3) {
    map<char, int>::iterator it = m.begin();
    for (; it != m.end(); it++) {
      if (it->second > 1) return !printf("Yes\n");
    }
    return !printf("No\n");
  } else
    return !printf("Yes\n");
}
