Update Proof.java

the input "~" will no longer crash the program.