
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
Given a line $l$ intersects with circle $C$: $x^2+y+2x-4y+a=0$ at points $A$ and $B$, and the midpoint of chord $AB$ is $M(0,1)$.

$(1)$ The range of the real number $a$ and the equation of line $l$;

$(2)$ If the chord $AB=2\sqrt{7}$, find the equation of the circle.

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