#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f;
string S;
char s[100005];
set<char> xd;
multiset<char> xdd;
int main() {
  cin >> S;
  int n = S.size();
  sort(s, s + n);
  for (int i = 0; i < n; ++i) {
    s[i] = S[i];
  }
  for (int i = 0; i < n; ++i) {
    xd.insert(s[i]);
    xdd.insert(s[i]);
  }
  if (xd.size() == 1 || xd.size() > 4)
    printf("No\n");
  else {
    auto it = xd.lower_bound('a');
    int a = xdd.count(*it);
    int b = a;
    while (it != xd.end()) {
      int x = xdd.count(*it);
      b = max(b, x);
      a = min(a, x);
      it = xd.upper_bound(*it);
    }
    if (xd.size() == 2 && a == 1)
      printf("No\n");
    else if (xd.size() == 3 && b == 1)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
