A set \( S \) of distinct positive integers is formed such that no two members differ by 4 or 7. Additionally, the arithmetic mean of the set \( S \) is an integer. What is the largest number of elements that \( S \) can have if the smallest element is 1 and the largest element is 2002? Let's think step by step and output the final answer within \boxed{}.
user