import calendar


def days_in_month(year, month):
    """
    Return the number of days in the given year and month, where month is
    1=January to 12=December, and respecting leap years as identified by
    `calendar.isleap()`
    """
    return {
        1: 31,
        2: 29 if calendar.isleap(year) else 28,
        3: 31,
        4: 30,
        5: 31,
        6: 30,
        7: 31,
        8: 31,
        9: 30,
        10: 31,
        11: 30,
        12: 31,
    }[month]