import math


def is_square(x):
    """Returns True if x is a perfect square. Otherwise False.

    Examples
    --------
    
    >>> is_square(1)
    True

    >>> is_square(-1)
    False

    >>> is_square(4)
    True
    """

    try:
        return int(math.sqrt(x)) == math.sqrt(x)
    except ValueError:
        return False