#include <bits/stdc++.h>
int main() {
  char *ch = new char[1000000];
  std::cin >> ch;
  std::vector<int> v(26, 0);
  int i = 0;
  while (ch[i] != '\0') {
    ++v[(int)((int)ch[i] - (int)'a')];
    ++i;
  }
  v.erase(std::remove(v.begin(), v.end(), 0), v.end());
  std::sort(v.begin(), v.end());
  if ((v.size() > 4) || (v.size() == 1)) {
    std::cout << "No";
    delete[] ch;
    return 0;
  } else if (v.size() == 2) {
    if ((v[0] > 1) && (v[1] > 1)) {
      std::cout << "Yes";
      return 0;
    } else {
      std::cout << "No";
      return 0;
    }
  } else if (v.size() == 3) {
    if ((v[0] > 1) || (v[1] > 1) || (v[2] > 1)) {
      std::cout << "Yes";
      return 0;
    } else {
      std::cout << "No";
      return 0;
    }
  } else if (v.size() == 4) {
    std::cout << "Yes";
    return 0;
  }
  return 0;
}
