Normally as a polarity protection diode I would say go for it...but considering there’s quite a few in series I would stick with the 1n4001. 5817 have a .3-.4v forward voltage while the 1n4001 has a .7v-ish drop. A trivial difference when there is only one...but with a bunch it may not work as intended with 5817.
You could always socket them and try it though, it may not make a difference.