#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 1e5 + 5, mod = 1e7;
char s[maxn];
int asc[maxn];
signed main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    asc[s[i] - 'a' + 1]++;
    if (asc[s[i] - 'a' + 1] == 1) cnt++;
  }
  sort(asc + 1, asc + 1 + 26);
  bool flag = 0;
  if (cnt == 4)
    flag = 1;
  else if (cnt == 3 && asc[26] >= 2)
    flag = 1;
  else if (cnt == 2 && asc[25] >= 2)
    flag = 1;
  printf(flag ? "Yes\n" : "No\n");
  return 0;
}
