How to move on to next step when null

In this Cypher, if '$input.alist' is null, it doesn't move on to next 'UNWIND'. But is there any way to move to next 'UNWIND'?

UNWIND $input.alist as a
MERGE
....
UNWIND $input.blist as b
MERGE...

I tried to use FOREACH, but it seems like there are some restriction that makes unable to use 'WITH' inside.

Not sure what's going on in the ...'s, but would conditional cypher execution help?
Conditional Cypher Execution - APOC Documentation (neo4j.com)