#B2078. Counting Threes

    ID: 11160 Type: Default 1000ms 256MiB

Counting Threes

Counting Threes

Given two positive integers $m$ and $k$, where $1 < m \leq 10^{15}$ and $1 < k \leq 15$, determine whether the decimal representation of $m$ contains exactly $k$ occurrences of the digit 3. If it does, output YES; otherwise, output NO.

inputFormat

The input consists of two space-separated positive integers $m$ and $k$.

outputFormat

Output a single line containing YES if $m$ contains exactly $k$ occurrences of the digit 3, and NO otherwise.

sample

33 2
YES