Added Validation for checking whether the finalNum & num