#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using str = string;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<ld, ld>;
const int MIN = 2e5 + 20;
const int MAX = 1e9 + 20;
str s;
set<char> se;
map<char, ll> m;
ll n, i, j, k;
int main() {
  cin >> s;
  for (auto to : s) {
    se.insert(to);
    m[to]++;
  }
  if (int((se).size()) == 2) {
    k = 1;
    for (auto to : se)
      if (m[to] < 2) {
        k = 0;
        break;
      }
    if (k) {
      cout << "Yes";
      return 0;
    }
  }
  if (int((se).size()) == 3 && int((s).size()) >= 4) {
    cout << "Yes";
    return 0;
  }
  if (int((se).size()) == 4 && int((s).size()) >= 4) {
    cout << "Yes";
    return 0;
  }
  cout << "No";
}
