S = input() d = {} for c in S: d.setdefault(c, 0) d[c] += 1 if d.values().count(1) == 1 and d.values().count(2) == 6: print('Yes') else: print('No')