#include <bits/stdc++.h>
using namespace std;
string a;
int b[999];
bool c() {
  int a = 0, B = 0;
  for (int i = 'a'; i <= 'z'; i++) {
    if (b[i] == 1)
      a++, B++;
    else if (b[i] > 1)
      a += 2, B++;
  }
  return a >= 4 && B <= 4;
}
int main() {
  cin >> a;
  for (int i = 0; i < (int)a.size(); i++) b[a[i]]++;
  cout << (c() ? "Yes" : "No") << endl;
  return 0;
}
