import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AFiftyFifty solver = new AFiftyFifty();
        solver.solve(1, in, out);
        out.close();
    }

    static class AFiftyFifty {
        PrintWriter out;
        InputReader in;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            this.out = out;
            this.in = in;
            String st = n();
            int[] freq = new int[26];
            int i = 0;
            for (i = 0; i < st.length(); i++)
                freq[st.charAt(i) - 'A']++;
            int lol = 1;
            for (i = 0; i < 26; i++) {
                lol *= Math.max(1, freq[i]);
                if (freq[i] == 4)
                    lol = 0;
            }
            pn(lol == 4 ? "Yes" : "No");
        }

        String n() {
            return in.next();
        }

        void pn(String zx) {
            out.println(zx);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AFiftyFifty solver = new AFiftyFifty();
        solver.solve(1, in, out);
        out.close();
    }

    static class AFiftyFifty {
        PrintWriter out;
        InputReader in;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            this.out = out;
            this.in = in;
            String st = n();
            int[] freq = new int[26];
            int i = 0;
            for (i = 0; i < st.length(); i++)
                freq[st.charAt(i) - 'A']++;
            int lol = 1;
            for (i = 0; i < 26; i++) {
                lol *= Math.max(1, freq[i]);
                if (freq[i] == 4)
                    lol = 0;
            }
            pn(lol == 4 ? "Yes" : "No");
        }

        String n() {
            return in.next();
        }

        void pn(String zx) {
            out.println(zx);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AFiftyFifty solver = new AFiftyFifty();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AFiftyFifty solver = new AFiftyFifty();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out InputReader in = new InputReader(inputStream); in new InputReader(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) AFiftyFifty solver = new AFiftyFifty(); solver new AFiftyFifty() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class AFiftyFifty {
        PrintWriter out;
        InputReader in;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            this.out = out;
            this.in = in;
            String st = n();
            int[] freq = new int[26];
            int i = 0;
            for (i = 0; i < st.length(); i++)
                freq[st.charAt(i) - 'A']++;
            int lol = 1;
            for (i = 0; i < 26; i++) {
                lol *= Math.max(1, freq[i]);
                if (freq[i] == 4)
                    lol = 0;
            }
            pn(lol == 4 ? "Yes" : "No");
        }

        String n() {
            return in.next();
        }

        void pn(String zx) {
            out.println(zx);
        }

    } AFiftyFifty PrintWriter out; out InputReader in; in public void solve(int testNumber, InputReader in, PrintWriter out) {
            this.out = out;
            this.in = in;
            String st = n();
            int[] freq = new int[26];
            int i = 0;
            for (i = 0; i < st.length(); i++)
                freq[st.charAt(i) - 'A']++;
            int lol = 1;
            for (i = 0; i < 26; i++) {
                lol *= Math.max(1, freq[i]);
                if (freq[i] == 4)
                    lol = 0;
            }
            pn(lol == 4 ? "Yes" : "No");
        } solve {
            this.out = out;
            this.in = in;
            String st = n();
            int[] freq = new int[26];
            int i = 0;
            for (i = 0; i < st.length(); i++)
                freq[st.charAt(i) - 'A']++;
            int lol = 1;
            for (i = 0; i < 26; i++) {
                lol *= Math.max(1, freq[i]);
                if (freq[i] == 4)
                    lol = 0;
            }
            pn(lol == 4 ? "Yes" : "No");
        } this.out = out this.out this this.out out this.in = in this.in this this.in in String st = n(); st n() n int[] freq = new int[26]; freq new int[26] 26 int i = 0; i 0 for (i = 0; i < st.length(); i++)
                freq[st.charAt(i) - 'A']++; i = 0; i = 0 i 0 i < st.length() i st.length() st.length st i++ i++ i freq[st.charAt(i) - 'A']++; freq[st.charAt(i) - 'A']++ freq[st.charAt(i) - 'A'] freq st.charAt(i) - 'A' st.charAt(i) st.charAt st i 'A' int lol = 1; lol 1 for (i = 0; i < 26; i++) {
                lol *= Math.max(1, freq[i]);
                if (freq[i] == 4)
                    lol = 0;
            } i = 0; i = 0 i 0 i < 26 i 26 i++ i++ i {
                lol *= Math.max(1, freq[i]);
                if (freq[i] == 4)
                    lol = 0;
            } {
                lol *= Math.max(1, freq[i]);
                if (freq[i] == 4)
                    lol = 0;
            } lol *= Math.max(1, freq[i]) lol Math.max(1, freq[i]) Math.max Math 1 freq[i] freq i if (freq[i] == 4)
                    lol = 0; freq[i] == 4 freq[i] freq i 4 lol = 0 lol 0 pn(lol == 4 ? "Yes" : "No") pn lol == 4 ? "Yes" : "No" lol == 4 lol 4 "Yes" "No" int testNumber testNumber InputReader in in PrintWriter out out String n() {
            return in.next();
        } n {
            return in.next();
        } return in.next(); in.next() in.next in void pn(String zx) {
            out.println(zx);
        } pn {
            out.println(zx);
        } out.println(zx) out.println out zx String zx zx static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    } InputReader private InputStream stream; stream private byte[] buf = new byte[1024]; buf new byte[1024] 1024 private int curChar; curChar private int numChars; numChars public InputReader(InputStream stream) {
            this.stream = stream;
        } InputReader {
            this.stream = stream;
        } this.stream = stream this.stream this this.stream stream InputStream stream stream public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        } read {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        } if (numChars == -1)
                throw new UnknownError(); numChars == -1 numChars -1 1 throw new UnknownError(); new UnknownError() if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            } curChar >= numChars curChar numChars {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            } curChar = 0 curChar 0 try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                } catch (IOException e) {
                    throw new UnknownError();
                } IOException e {
                    throw new UnknownError();
                } throw new UnknownError(); new UnknownError() {
                    numChars = stream.read(buf);
                } numChars = stream.read(buf) numChars stream.read(buf) stream.read stream buf if (numChars <= 0)
                    return -1; numChars <= 0 numChars 0 return -1; -1 1 return buf[curChar++]; buf[curChar++] buf curChar++ curChar public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        } next {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        } int c = read(); c read() read while (isSpaceChar(c))
                c = read(); isSpaceChar(c) isSpaceChar c c = read() c read() read StringBuffer res = new StringBuffer(); res new StringBuffer() do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
                res.appendCodePoint(c);
                c = read();
            } res.appendCodePoint(c) res.appendCodePoint res c c = read() c read() read return res.toString(); res.toString() res.toString res private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        } isSpaceChar {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        } return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == '\t' c == '\r' c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == ' ' c ' ' c == '\n' c '\n' c == '\r' c '\r' c == '\t' c '\t' c == -1 c -1 1 int c c public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AFiftyFifty solver = new AFiftyFifty();
        solver.solve(1, in, out);
        out.close();
    }

    static class AFiftyFifty {
        PrintWriter out;
        InputReader in;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            this.out = out;
            this.in = in;
            String st = n();
            int[] freq = new int[26];
            int i = 0;
            for (i = 0; i < st.length(); i++)
                freq[st.charAt(i) - 'A']++;
            int lol = 1;
            for (i = 0; i < 26; i++) {
                lol *= Math.max(1, freq[i]);
                if (freq[i] == 4)
                    lol = 0;
            }
            pn(lol == 4 ? "Yes" : "No");
        }

        String n() {
            return in.next();
        }

        void pn(String zx) {
            out.println(zx);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AFiftyFifty solver = new AFiftyFifty();
        solver.solve(1, in, out);
        out.close();
    }

    static class AFiftyFifty {
        PrintWriter out;
        InputReader in;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            this.out = out;
            this.in = in;
            String st = n();
            int[] freq = new int[26];
            int i = 0;
            for (i = 0; i < st.length(); i++)
                freq[st.charAt(i) - 'A']++;
            int lol = 1;
            for (i = 0; i < 26; i++) {
                lol *= Math.max(1, freq[i]);
                if (freq[i] == 4)
                    lol = 0;
            }
            pn(lol == 4 ? "Yes" : "No");
        }

        String n() {
            return in.next();
        }

        void pn(String zx) {
            out.println(zx);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AFiftyFifty solver = new AFiftyFifty();
        solver.solve(1, in, out);
        out.close();
    }

    static class AFiftyFifty {
        PrintWriter out;
        InputReader in;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            this.out = out;
            this.in = in;
            String st = n();
            int[] freq = new int[26];
            int i = 0;
            for (i = 0; i < st.length(); i++)
                freq[st.charAt(i) - 'A']++;
            int lol = 1;
            for (i = 0; i < 26; i++) {
                lol *= Math.max(1, freq[i]);
                if (freq[i] == 4)
                    lol = 0;
            }
            pn(lol == 4 ? "Yes" : "No");
        }

        String n() {
            return in.next();
        }

        void pn(String zx) {
            out.println(zx);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}

