4

MATL, 34 29 26 bytes
:G\2<t!+gQ"@!2GVYX1GVnZ"YX
This works with current release (13.0.0) of the language/compiler
Try it online!
: % array [1,2,...,N], where N is input, taken implicitly
G\ % modulo N. Gives [1,2,...,N-1,0]
2< % smaller than 2? Gives [1,0,...,...