def year_month_period(start_year, start_month, end_year, end_month):
    """
    Generate all year,month tuple between given time period
    :param start_year: int, start from this year
    :param start_month: int, start from this month
    :param end_year: int, end to this year(inclusive)
    :param end_month: int, end to this month(inclusive)
    :return: list[tuple(year, month)]
    """
    ym_list = []
    for year in range(start_year, end_year + 1):
        st_month = start_month if year == start_year else 1
        ed_month = end_month if year == end_year else 12
        months = range(st_month, ed_month + 1)
        for month in months:
            ym_list.append((year, month))
    return ym_list