Language: Java

import java.io.*;
import java.lang.reflect.Array;
import java.util.*;
public class Main {

    public static void main(String[] args) {
        InputReader sc = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        Random gen = new Random();
        int test = 1;//sc.nextInt();
        while(test-->0) {

            String s = sc.nextLine();
            String fh = s.substring(0,s.length()/2);
            String sh = s.import java.io.BufferedReader; 
import java.io.*;
import java.io.InputStreamReader; 
import java.util.Scanner; 
import java.util.StringTokenizer; 
import java.util.*;
import java.math.*;
public class Main 
{ 
    static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader()
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next()
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine();
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
   public static void main(String args[])
    {
        FastReader sc=new FastReader();
        PrintWriter pw=new PrintWriter(System.out);
        int t=1;//sc.nextInt(),k=0;
        long ans=0,mod=1000000007;
        while(t-->0)
        {
         String s = sc.next();
            String f = s.substring(0,s.length()/2);
            String st = s.substring(s.length()/2 +1);

            if(new StringBuffer(s).reverse().toString().equals(s) && new StringBuffer(f).reverse().toString().equals(f) &&new StringBuffer(st).reverse().toString().equals(st))
                pw.println("Yes");
            else
                pw.println("No");
        }
           pw.close();
    }
}
  string(s.length()/2 +1);

            if(new StringBuffer(s).reverse().toString().equals(s) && new StringBuffer(fh).reverse().toString().equals(fh) &&new StringBuffer(sh).reverse().toString().equals(sh))
                pw.println("Yes");
            else
                pw.println("No");
        }
        pw.close();

    }



























































































































































































    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;

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

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

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int [] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public static int[] shuffle(int[] a, Random gen)
        { for(int i = 0, n = a.length;i < n;i++)
        { int ind = gen.nextInt(n-i)+i;
            int d = a[i];
            a[i] = a[ind];
            a[ind] = d;

        }
            return a;
        }


        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

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

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

    }

}

Compiler output:
Main.java:15: error: <identifier> expected
            String sh = s.import java.io.BufferedReader; 
                          ^
Main.java:15: error: not a statement
            String sh = s.import java.io.BufferedReader; 
                                        ^
Main.java:16: error: illegal start of expression
import java.io.*;
^
Main.java:16: error: <identifier> expected
import java.io.*;
               ^
Main.java:16: error: illegal start of expression
import java.io.*;
                ^
Main.java:17: error: illegal start of expression
import java.io.InputStreamReader; 
^
Main.java:17: error: not a statement
import java.io.InputStreamReader; 
              ^
Main.java:18: error: illegal start of expression
import java.util.Scanner; 
^
Main.java:18: error: not a statement
import java.util.Scanner; 
                ^
Main.java:19: error: illegal start of expression
import java.util.StringTokenizer; 
^
Main.java:19: error: not a statement
import java.util.StringTokenizer; 
                ^
Main.java:20: error: illegal start of expression
import java.util.*;
^
Main.java:20: error: <identifier> expected
import java.util.*;
                 ^
Main.java:20: error: illegal start of expression
import java.util.*;
                  ^
Main.java:21: error: illegal start of expression
import java.math.*;
^
Main.java:21: error: <identifier> expected
import java.math.*;
                 ^
Main.java:21: error: illegal start of expression
import java.math.*;
                  ^
Main.java:22: error: illegal start of expression
public class Main 
^
Main.java:100: error: invalid method declaration; return type required
  string(s.length()/2 +1);
  ^
Main.java:100: error: <identifier> expected
  string(s.length()/2 +1);
                 ^
Main.java:102: error: illegal start of type
            if(new StringBuffer(s).reverse().toString().equals(s) && new StringBuffer(fh).reverse().toString().equals(fh) &&new StringBuffer(sh).reverse().toString().equals(sh))
            ^
Main.java:102: error: invalid method declaration; return type required
            if(new StringBuffer(s).reverse().toString().equals(s) && new StringBuffer(fh).reverse().toString().equals(fh) &&new StringBuffer(sh).reverse().toString().equals(sh))
                   ^
Main.java:102: error: <identifier> expected
            if(new StringBuffer(s).reverse().toString().equals(s) && new StringBuffer(fh).reverse().toString().equals(fh) &&new StringBuffer(sh).reverse().toString().equals(sh))
                                 ^
Main.java:102: error: ';' expected
            if(new StringBuffer(s).reverse().toString().equals(s) && new StringBuffer(fh).reverse().toString().equals(fh) &&new StringBuffer(sh).reverse().toString().equals(sh))
                                  ^
Main.java:104: error: illegal start of type
            else
            ^
Main.java:105: error: <identifier> expected
                pw.println("No");
                          ^
Main.java:105: error: illegal start of type
                pw.println("No");
                           ^
Main.java:107: error: class, interface, enum, or record expected
        pw.close();
        ^
Main.java:109: error: class, interface, enum, or record expected
    }
    ^
Main.java:416: error: class, interface, enum, or record expected
}
^
30 errors