def isPrime(x):
    """
    Checks whether the given
    number x is prime or not
    """

    if x == 2:
        return True

    if x % 2 == 0:
        return False

    for i in range(3, int(x ** 0.5) + 1, 2):
        if x % i == 0:
            return False

    return True