
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
On an island, there live knights, liars, and yes-men; each knows who is who among them. In a row, 2018 island inhabitants were asked the question: "Are there more knights than liars on the island?" Each inhabitant answered either "Yes" or "No" in turn such that everyone else could hear their response. Knights always tell the truth, liars always lie. Each yes-man answered according to the majority of responses given before their turn, or gave either response if there was a tie. It turned out that exactly 1009 answered "Yes." What is the maximum number of yes-men that could be among the island inhabitants?

Present the answer in LaTex format: \boxed{Your answer}
user