Local Systems on P1 - S for S a Finite Set

I give the necessary and sufficient conditions for the existence of Unitary local systems with prescribed local monodromies on P1 − S where S is a finite set. This is used to give an algorithm to decide if a rigid local system on P1 − S has finite global monodromy, thereby answering a question of N. Katz. The methods of this article (use of Harder–Narasimhan filtrations) are used to strengthen Klyachko's theorem on sums of Hermitian matrices. In the Appendix, I give a reformulation of Mehta–Seshadri theorem in the SU(n) setting.