#include <bits/stdc++.h>
using namespace std;
int a[100001], cnt = 0;
string s1 = "", s;
int main() {
  cin >> s;
  if (s.size() <= 3) {
    cout << "No";
    return 0;
  }
  for (int i = 0; i <= 50; i++) {
    a[i] = 0;
  }
  for (int i = 0; i < s.size(); i++) {
    if (a[s[i] - 97] == 0) {
      cnt++;
    }
    a[s[i] - 97]++;
  }
  if (cnt <= 4) {
    if (cnt == 1) {
      cout << "No";
      return 0;
    }
    if (cnt == 2) {
      int a1 = 0, b1 = 0;
      for (int i = 0; i <= 50; i++) {
        if (a1 == 0 && a[i] != 0) {
          a1 = a[i];
        }
        if (a1 != 0 && a[i] != 0) {
          b1 = a[i];
        }
      }
      if (min(a1, b1) == 1) {
        cout << "No";
        return 0;
      }
    }
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}
