Bidirectional Quine Chain PPCG hasn't had enough of quines already...

Challenge:

Your task is to create a program "A0". When this program is run with no input, it outputs nothing. When this program is run with input, it outputs "A1". When "A1" is run with no input, it outputs "A0". When "A1" is run with input, it outputs "A2". Pretty much, "A(k)" will output "A(k-1)" when run with no input, and will output "A(k+1)" when run with input.

Details

I believe this challenge is simple enough; there are no other rules really. Every program must contain at least 1 byte, by the way. You may assume that the input will consist of only ASCII characters, and you may ignore whitespace if you want, but you may not specify a specific input. Output may be to either STDOUT or STDERR, but all of your programs must output to the same one. The other one may also contain text (so you may output to STDOUT and then exit with an error). Thanks to @Dennis for pointing that out.

All programs must be in the same language, and each program must be unique from the rest of them.

The score is equal to the length of program "A0". As this is a code-golf challenge, the lowest score wins!
Python 2, 93 bytes
There is a trailing linefeed.

p=1+2*bool(input())-1;s='print&quot;p=%r+2*bool(input())-1;s=%r*(p&gt;0);exec s&quot;%(p,s)'*(p&gt;0);exec s

Try it with input | Try it without input
This is modified from my answer on a similar question.
If there is input, then it will increment p. So the resulting program will be p=2+..., p=3+..., etc.