Do TEXCOORDS need to be in sequence?

do the texcoord values in the vert to frag struct need to be in sequence? for example can i have a struct like this

struct v2f

float2 UV: TEXCOORD0;
float3 Color: TEXCOORD5;


or do they have to be ordered 012345.
im asking because i have a shader with multiple compile setups that need different values in the vert to frag struct.

I didn’t notice any particular issue with fancy orders on DX9, DX11 and OpenGL, but I feel better with a serie of #ifdef like so:

float2 uv : TEXCOORD0;

#if defined (FEATURE_A) || defined (FEATURE_B) 
       float4 color : TEXCOORD1;
       float3 fancyThing : TEXCOORD2;
      float3 fancyThing : TEXCOORD1;

Edit: This is how it is done in builtin shaders, so I guess it is the way to go.