#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  map<char, int> x;
  for (int i = 0; i < s.size(); ++i) {
    x[s[i]]++;
  }
  int mn = 1e9;
  for (auto it = x.begin(); it != x.end(); ++it) {
    mn = min(it->second, mn);
  }
  if (x.size() > 4 || x.size() == 1 || s.size() < 4 ||
      x.size() == 2 && mn == 1) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}
int main() {
  solve();
  return 0;
}
