  Let $\phi$ be an endomorphism of the projective line defined over a global
field $K$. We prove a bound for the cardinality of the set of $K$-rational
preperiodic points for $\phi$ in terms of the number of places of bad
reduction. The result is completely new in the function fields case and it is
an improvement of the number fields case. An important tool is an $S$-unit
equation theorem in 2 variables.
