#include <bits/stdc++.h>
using namespace std;
int c[30];
string s;
int main() {
  cin >> s;
  for (auto& p : s) {
    c[p - 'a']++;
  }
  sort(c, c + 26, greater<int>());
  int n = 0;
  for (; c[n]; n++)
    ;
  if (n > 5)
    puts("No");
  else if (n == 4)
    puts("Yes");
  else if (n == 3 && c[0] >= 2)
    puts("Yes");
  else if (n == 2 && c[0] >= 2 && c[1] >= 2)
    puts("Yes");
  else
    puts("No");
  return 0;
}
