Reproduces on master.

```
SELECT toDateTime64('2021-03-22', 3, 'Asia/Tehran')

Query id: 26f7c373-f473-4209-8976-6ada79a8627f

┌─toDateTime64('2021-03-22', 3, 'Asia/Tehran')─┐
│                      2157-04-28 06:28:16.000 │
└──────────────────────────────────────────────┘
```
if (toMonth(i) == 1 && toDayOfMonth(i) <= static_cast<UInt32>(7 - weekday))
        {
            if (!week_year_mode && ((first_weekday_mode && weekday != 0) || (!first_weekday_mode && weekday >= 4)))
                return yw;
            week_year_mode = 1;
            (yw.first)--;
            first_daynr -= (days = calc_days_in_year(yw.first));
            weekday = (weekday + 53 * 7 - days) % 7;
        }
        if ((first_weekday_mode && weekday != 0) || (!first_weekday_mode && weekday >= 4))
            days = daynr - (first_daynr + (7 - weekday));
        else
            days = daynr - (first_daynr - weekday);
        if (week_year_mode && days >= 52 * 7)
        {
            weekday = (weekday + calc_days_in_year(yw.first)) % 7;
            if ((!first_weekday_mode && weekday < 4) || (first_weekday_mode && weekday == 0))
            {
                (yw.first)++;
                yw.second = 1;
                return yw;
            }
        }
        yw.second = days / 7 + 1;
        return yw;
    }
    
    
    template <typename DateOrTime>
    inline YearWeek toYearWeekOfNewyearMode(DateOrTime v, bool monday_first_mode) const