import re


def valid_email(email):
    """Checks if email is valid"""
    # accepts emails following x@x.x format
    email_re = re.compile(r'^[\S]+@[\S]+\.[\S]+$')
    return not email or email_re.match(email)