as I said, what you are suggesting will lead to 0 and 1 but it's going to be mostly 0 and only 1 if the input value is read at 1023.
so technically work, but does it match your needs/expectations is the real question.
➜ the expression where you compare the analogRead value lets you set the threshold under which it's 0 and above which it's 1.
➜ the digitalRead() will give you 0 and 1 but you don't get to set the exact threshold