R.I.M . , which has its headquarters in Waterloo , Ontario , has become Canada 's technology success story , with a soaring stock price and two million subscribers , most of them in the United States .