import re

def is_valid_URL(str):
    pattern = r'^(https?://)(www\.)?[a-zA-Z0-9@:%._\+~#?&/=-]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$'
    return bool(re.match(pattern, str))