#include <bits/stdc++.h>
using namespace std;
int main() {
  string buffer;
  cin >> buffer;
  int count = 0;
  map<char, int> symbols;
  bool found;
  for (auto ch : buffer) {
    found = false;
    for (auto sym : symbols) {
      if (sym.first == ch) {
        symbols[ch]++;
        found = true;
        break;
      }
    }
    if (found == false) {
      symbols[ch] = 1;
      count++;
      if (count >= 5) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  if (count < 2) {
    cout << "No" << endl;
    return 0;
  } else if (count == 2) {
    for (auto sym : symbols) {
      if (sym.second < 2) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  } else if (count == 3) {
    for (auto sym : symbols) {
      if (sym.second >= 2) {
        cout << "Yes" << endl;
        return 0;
      }
    }
    cout << "No" << endl;
    return 0;
  } else {
    cout << "Yes" << endl;
  }
  return 0;
}
