Check whether a given number is prime or not