A 66-year-old man presents with difficulty swallowing (dysphagia), initially for solids but now progressing to liquids over the past 3 months. He also reports unintentional weight loss of 5kg. He is an ex-smoker and drinks alcohol moderately. What is the most appropriate initial investigation?