how you would compute/denote the time complexity of two loops based on different variables?

I understand how to compute the time complexity for a simple loop

PseduoCode

while X<N

{

while Y<M

{

Z++

}

X++

}

one loop occurs N times - time complexity O(N)

the other loop occurs M - time complexity 0(M)

M- happens to be a unknown function of N

would the time complexity O(MN)?

but In big O notation you are to drop all excess variables

in which case time complexity would be O(N)?

or neither? please help