Arrive SFO on the later flight instead of the earlier flight, and depart SFO on the later flight instead of the earlier flight. Better for jetlag and immigration/custom and security.
ex post facto edit re Lolbert's post below: This is why one should arrive on the later flight.