Yes, you'll have to clear both US and Canadian customs at YVR. I haven't connected through YVR internationally in quite some time. Probably somebody else can help you better... from my last experience 2hrs would be the absolutely minimum (i remember a lot of walking).