#C5909. Playlist Feasibility

    ID: 49610 Type: Default 1000ms 256MiB

Playlist Feasibility

Playlist Feasibility

You are given two integers f and s where f represents the number of fast-paced songs and s represents the number of slow-paced songs. A playlist is considered feasible if it obeys the following rules:

  • No more than 3 fast-paced songs can appear consecutively.
  • After every group of 3 consecutive fast-paced songs, there must be at least 1 slow-paced song inserted before another fast-paced song can appear.

Mathematically, the minimum number of slow-paced songs required is given by the formula: $$ required = \left\lfloor \frac{f - 1}{3} \right\rfloor $$ (with the convention that if f is 0, then no slow-paced song is needed). Your task is to determine whether it is possible to form a playlist with the given numbers under these rules.

inputFormat

The input consists of two integers f and s separated by whitespace from standard input. Here, f is the number of fast-paced songs and s is the number of slow-paced songs.

outputFormat

Print 'YES' if a playlist meeting the criteria can be created; otherwise, print 'NO'. The output should be written to standard output.## sample

7 3
YES