import java.util.Scanner;
import java.io.PrintWriter;
import java.util.Stack;

class Main {
    static boolean isStrongAnagram(String s) {
        int length = s.length();
        int mid = (length - 1) / 2;
        boolean isMidOdd = mid % 2 == 1;
        int mid1 = (mid - 1) / 2;
        if (!isMidOdd) mid1 ++;
        int start2 = (length + 1) / 2;
        int mid2 = start2 + mid1;
        Stack<Character> stackAll = new Stack<>();
        Stack<Character> stackSub = new Stack<>();
        char c, tmp;
        for (int i = 0; i < length; i ++) {
            c = s.charAt(i);
            if (i < mid) {
                stackAll.push(c);
                if (i < mid1) {
                    stackSub.push(c);
                } else if (!isMidOdd || i > mid1) {
                    tmp = stackSub.pop();
                    if (c != tmp) return false;
                }
            } else if (i == mid) {
                if (!stackSub.isEmpty()) return false;
            } else {
                tmp = stackAll.pop();
                if (c != tmp) return false;
                if (i >= start2) {
                    if (i < mid2) {
                        stackSub.push(c);
                    } else if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    }
                }
            }
        }
        if (!stackAll.isEmpty() || !stackSub.isEmpty()) return false;
        return true;
    }


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String s = sc.next();

        if (isStrongAnagram(s)) {
            out.println("Yes");
        } else {
            out.println("No");
        }
        out.flush();
    }
} import java.util.Scanner; Scanner java.util import java.io.PrintWriter; PrintWriter java.io import java.util.Stack; Stack java.util class Main {
    static boolean isStrongAnagram(String s) {
        int length = s.length();
        int mid = (length - 1) / 2;
        boolean isMidOdd = mid % 2 == 1;
        int mid1 = (mid - 1) / 2;
        if (!isMidOdd) mid1 ++;
        int start2 = (length + 1) / 2;
        int mid2 = start2 + mid1;
        Stack<Character> stackAll = new Stack<>();
        Stack<Character> stackSub = new Stack<>();
        char c, tmp;
        for (int i = 0; i < length; i ++) {
            c = s.charAt(i);
            if (i < mid) {
                stackAll.push(c);
                if (i < mid1) {
                    stackSub.push(c);
                } else if (!isMidOdd || i > mid1) {
                    tmp = stackSub.pop();
                    if (c != tmp) return false;
                }
            } else if (i == mid) {
                if (!stackSub.isEmpty()) return false;
            } else {
                tmp = stackAll.pop();
                if (c != tmp) return false;
                if (i >= start2) {
                    if (i < mid2) {
                        stackSub.push(c);
                    } else if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    }
                }
            }
        }
        if (!stackAll.isEmpty() || !stackSub.isEmpty()) return false;
        return true;
    }


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String s = sc.next();

        if (isStrongAnagram(s)) {
            out.println("Yes");
        } else {
            out.println("No");
        }
        out.flush();
    }
} Main static boolean isStrongAnagram(String s) {
        int length = s.length();
        int mid = (length - 1) / 2;
        boolean isMidOdd = mid % 2 == 1;
        int mid1 = (mid - 1) / 2;
        if (!isMidOdd) mid1 ++;
        int start2 = (length + 1) / 2;
        int mid2 = start2 + mid1;
        Stack<Character> stackAll = new Stack<>();
        Stack<Character> stackSub = new Stack<>();
        char c, tmp;
        for (int i = 0; i < length; i ++) {
            c = s.charAt(i);
            if (i < mid) {
                stackAll.push(c);
                if (i < mid1) {
                    stackSub.push(c);
                } else if (!isMidOdd || i > mid1) {
                    tmp = stackSub.pop();
                    if (c != tmp) return false;
                }
            } else if (i == mid) {
                if (!stackSub.isEmpty()) return false;
            } else {
                tmp = stackAll.pop();
                if (c != tmp) return false;
                if (i >= start2) {
                    if (i < mid2) {
                        stackSub.push(c);
                    } else if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    }
                }
            }
        }
        if (!stackAll.isEmpty() || !stackSub.isEmpty()) return false;
        return true;
    } isStrongAnagram {
        int length = s.length();
        int mid = (length - 1) / 2;
        boolean isMidOdd = mid % 2 == 1;
        int mid1 = (mid - 1) / 2;
        if (!isMidOdd) mid1 ++;
        int start2 = (length + 1) / 2;
        int mid2 = start2 + mid1;
        Stack<Character> stackAll = new Stack<>();
        Stack<Character> stackSub = new Stack<>();
        char c, tmp;
        for (int i = 0; i < length; i ++) {
            c = s.charAt(i);
            if (i < mid) {
                stackAll.push(c);
                if (i < mid1) {
                    stackSub.push(c);
                } else if (!isMidOdd || i > mid1) {
                    tmp = stackSub.pop();
                    if (c != tmp) return false;
                }
            } else if (i == mid) {
                if (!stackSub.isEmpty()) return false;
            } else {
                tmp = stackAll.pop();
                if (c != tmp) return false;
                if (i >= start2) {
                    if (i < mid2) {
                        stackSub.push(c);
                    } else if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    }
                }
            }
        }
        if (!stackAll.isEmpty() || !stackSub.isEmpty()) return false;
        return true;
    } int length = s.length(); length s.length() s.length s int mid = (length - 1) / 2; mid (length - 1) / 2 (length - 1) length 1 2 boolean isMidOdd = mid % 2 == 1; isMidOdd mid % 2 == 1 mid % 2 mid 2 1 int mid1 = (mid - 1) / 2; mid1 (mid - 1) / 2 (mid - 1) mid 1 2 if (!isMidOdd) mid1 ++; !isMidOdd isMidOdd mid1 ++ mid1 int start2 = (length + 1) / 2; start2 (length + 1) / 2 (length + 1) length 1 2 int mid2 = start2 + mid1; mid2 start2 + mid1 start2 mid1 Stack<Character> stackAll = new Stack<>(); stackAll new Stack<>() Stack<Character> stackSub = new Stack<>(); stackSub new Stack<>() char c c tmp; tmp for (int i = 0; i < length; i ++) {
            c = s.charAt(i);
            if (i < mid) {
                stackAll.push(c);
                if (i < mid1) {
                    stackSub.push(c);
                } else if (!isMidOdd || i > mid1) {
                    tmp = stackSub.pop();
                    if (c != tmp) return false;
                }
            } else if (i == mid) {
                if (!stackSub.isEmpty()) return false;
            } else {
                tmp = stackAll.pop();
                if (c != tmp) return false;
                if (i >= start2) {
                    if (i < mid2) {
                        stackSub.push(c);
                    } else if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    }
                }
            }
        } int i = 0; int i = 0; i 0 i < length i length i ++ i ++ i {
            c = s.charAt(i);
            if (i < mid) {
                stackAll.push(c);
                if (i < mid1) {
                    stackSub.push(c);
                } else if (!isMidOdd || i > mid1) {
                    tmp = stackSub.pop();
                    if (c != tmp) return false;
                }
            } else if (i == mid) {
                if (!stackSub.isEmpty()) return false;
            } else {
                tmp = stackAll.pop();
                if (c != tmp) return false;
                if (i >= start2) {
                    if (i < mid2) {
                        stackSub.push(c);
                    } else if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    }
                }
            }
        } {
            c = s.charAt(i);
            if (i < mid) {
                stackAll.push(c);
                if (i < mid1) {
                    stackSub.push(c);
                } else if (!isMidOdd || i > mid1) {
                    tmp = stackSub.pop();
                    if (c != tmp) return false;
                }
            } else if (i == mid) {
                if (!stackSub.isEmpty()) return false;
            } else {
                tmp = stackAll.pop();
                if (c != tmp) return false;
                if (i >= start2) {
                    if (i < mid2) {
                        stackSub.push(c);
                    } else if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    }
                }
            }
        } c = s.charAt(i) c s.charAt(i) s.charAt s i if (i < mid) {
                stackAll.push(c);
                if (i < mid1) {
                    stackSub.push(c);
                } else if (!isMidOdd || i > mid1) {
                    tmp = stackSub.pop();
                    if (c != tmp) return false;
                }
            } else if (i == mid) {
                if (!stackSub.isEmpty()) return false;
            } else {
                tmp = stackAll.pop();
                if (c != tmp) return false;
                if (i >= start2) {
                    if (i < mid2) {
                        stackSub.push(c);
                    } else if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    }
                }
            } i < mid i mid {
                stackAll.push(c);
                if (i < mid1) {
                    stackSub.push(c);
                } else if (!isMidOdd || i > mid1) {
                    tmp = stackSub.pop();
                    if (c != tmp) return false;
                }
            } stackAll.push(c) stackAll.push stackAll c if (i < mid1) {
                    stackSub.push(c);
                } else if (!isMidOdd || i > mid1) {
                    tmp = stackSub.pop();
                    if (c != tmp) return false;
                } i < mid1 i mid1 {
                    stackSub.push(c);
                } stackSub.push(c) stackSub.push stackSub c if (!isMidOdd || i > mid1) {
                    tmp = stackSub.pop();
                    if (c != tmp) return false;
                } !isMidOdd || i > mid1 !isMidOdd isMidOdd i > mid1 i mid1 {
                    tmp = stackSub.pop();
                    if (c != tmp) return false;
                } tmp = stackSub.pop() tmp stackSub.pop() stackSub.pop stackSub if (c != tmp) return false; c != tmp c tmp return false; false if (i == mid) {
                if (!stackSub.isEmpty()) return false;
            } else {
                tmp = stackAll.pop();
                if (c != tmp) return false;
                if (i >= start2) {
                    if (i < mid2) {
                        stackSub.push(c);
                    } else if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    }
                }
            } i == mid i mid {
                if (!stackSub.isEmpty()) return false;
            } if (!stackSub.isEmpty()) return false; !stackSub.isEmpty() stackSub.isEmpty() stackSub.isEmpty stackSub return false; false {
                tmp = stackAll.pop();
                if (c != tmp) return false;
                if (i >= start2) {
                    if (i < mid2) {
                        stackSub.push(c);
                    } else if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    }
                }
            } tmp = stackAll.pop() tmp stackAll.pop() stackAll.pop stackAll if (c != tmp) return false; c != tmp c tmp return false; false if (i >= start2) {
                    if (i < mid2) {
                        stackSub.push(c);
                    } else if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    }
                } i >= start2 i start2 {
                    if (i < mid2) {
                        stackSub.push(c);
                    } else if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    }
                } if (i < mid2) {
                        stackSub.push(c);
                    } else if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    } i < mid2 i mid2 {
                        stackSub.push(c);
                    } stackSub.push(c) stackSub.push stackSub c if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    } !isMidOdd || i > mid2 !isMidOdd isMidOdd i > mid2 i mid2 {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    } tmp = stackSub.pop() tmp stackSub.pop() stackSub.pop stackSub if (c != tmp) return false; c != tmp c tmp return false; false if (!stackAll.isEmpty() || !stackSub.isEmpty()) return false; !stackAll.isEmpty() || !stackSub.isEmpty() !stackAll.isEmpty() stackAll.isEmpty() stackAll.isEmpty stackAll !stackSub.isEmpty() stackSub.isEmpty() stackSub.isEmpty stackSub return false; false return true; true String s s public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String s = sc.next();

        if (isStrongAnagram(s)) {
            out.println("Yes");
        } else {
            out.println("No");
        }
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String s = sc.next();

        if (isStrongAnagram(s)) {
            out.println("Yes");
        } else {
            out.println("No");
        }
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) String s = sc.next(); s sc.next() sc.next sc if (isStrongAnagram(s)) {
            out.println("Yes");
        } else {
            out.println("No");
        } isStrongAnagram(s) isStrongAnagram s {
            out.println("Yes");
        } out.println("Yes") out.println out "Yes" {
            out.println("No");
        } out.println("No") out.println out "No" out.flush() out.flush out String[] args args
import java.util.Scanner;
import java.io.PrintWriter;
import java.util.Stack;

class Main {
    static boolean isStrongAnagram(String s) {
        int length = s.length();
        int mid = (length - 1) / 2;
        boolean isMidOdd = mid % 2 == 1;
        int mid1 = (mid - 1) / 2;
        if (!isMidOdd) mid1 ++;
        int start2 = (length + 1) / 2;
        int mid2 = start2 + mid1;
        Stack<Character> stackAll = new Stack<>();
        Stack<Character> stackSub = new Stack<>();
        char c, tmp;
        for (int i = 0; i < length; i ++) {
            c = s.charAt(i);
            if (i < mid) {
                stackAll.push(c);
                if (i < mid1) {
                    stackSub.push(c);
                } else if (!isMidOdd || i > mid1) {
                    tmp = stackSub.pop();
                    if (c != tmp) return false;
                }
            } else if (i == mid) {
                if (!stackSub.isEmpty()) return false;
            } else {
                tmp = stackAll.pop();
                if (c != tmp) return false;
                if (i >= start2) {
                    if (i < mid2) {
                        stackSub.push(c);
                    } else if (!isMidOdd || i > mid2) {
                        tmp = stackSub.pop();
                        if (c != tmp) return false;
                    }
                }
            }
        }
        if (!stackAll.isEmpty() || !stackSub.isEmpty()) return false;
        return true;
    }


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String s = sc.next();

        if (isStrongAnagram(s)) {
            out.println("Yes");
        } else {
            out.println("No");
        }
        out.flush();
    }
}
