#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long int a[26], c = 0;
  for (long long int i = 0; i < 26; i++) a[i] = 0;
  for (long long int i = 0; i < s.length(); i++) {
    long long int x = int(s[i]) - 97;
    a[x]++;
  }
  for (long long int i = 0; i < 26; i++) {
    if (a[i] > 0) c++;
  }
  if (c == 2) {
    long long int co = 0;
    for (long long int i = 0; i < 26; i++) {
      if (a[i] > 1) co++;
    }
    if (co == 2)
      cout << "Yes\n";
    else
      cout << "No\n";
  } else if (c == 3) {
    long long int co = 0;
    for (long long int i = 0; i < 26; i++) {
      if (a[i] > 1) co++;
    }
    if (co > 0)
      cout << "Yes\n";
    else
      cout << "No\n";
  } else if (c == 4)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
