How do I train by changing the order of the training set?

I want to compare the performance values when training the order of the two training sets differently, A and B.training in Train Set A first and then Train Set B, but I don’t know what to do.
When I modify the data.yaml file, do I just have to change the order of the train part?
And what should I do when I mix training sets randomly?

train: # train images (relative to 'path')
  - images/data_A
  - images/data_B
or 
  - images/data_B
  - images/data_A

Training data is shuffled by default so the order you use in your YAML will have no effect on the results.

I am working on the following project for obstacles in maritime settings

where I want to use the following challenge: MaCVi 2024 | 2nd Maritime Computer Vision Workshop

to develop a model for object detection, specifically with obstacles in maritime settings. For a baseline, I want to train YOLO (YOLOv5 | PyTorch) on the challenge dataset and make some improvement.

Can someone guide me on how to implement the model ?
Thank you for your consideration and for your time doing this