judge input is valid or not, can check can it be place.