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