Let $S$ be a subset of $\{1, 2, 3, \cdots, 1989 \}$ in which no two members differ by exactly $4$ or by exactly $7$. What is the largest number of elements $S$ can have?

Let's think step by step and output the final answer within \boxed{}.
user