I give the necessary and sufficient conditions for the existence of Unitary local systems with prescribed local monodromies on $\mathbb P$1 − S where S is a finite set. This is used to give an algorithm to decide if a rigid local system on $\mathbb P$1 − 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.