How to add a logo to the upper-right or bottom-right of each page in beamer

Friends, I'd like to add a logo to the upper-right or bottom-right of each page in beamer. But I cannot figure it out. I can only add it to the footline. In this case, the title and name are omitted. How can I solve it? Here is a minimal example of my Beamer TeX. Thanks a lot.

\documentclass[12pt,xcolor={svgnames},hyperref={colorlinks,linkcolor=blue,citecolor=blue}]{beamer}
\mode<presentation> {
\usecolortheme{beaver}
\usefonttheme{serif}  % or try serif, structurebold, ...
}
\usepackage{indentfirst,amsmath, multicol,amssymb}
\usepackage{caption}
\usepackage{booktabs,colortbl}

\usepackage{grffile,threeparttable}
\usepackage{graphicx,subfig,graphbox}
\usepackage{tikz}
\usepackage[absolute,overlay]{textpos}
\setbeamertemplate{caption,footline}[numbered]

\def\name{Yan}
\hypersetup{
urlcolor = blue,
pdfauthor = {\name},
}
\title[Introduction ]{An Introduction}
\author{
Yan}
\institute[CU]

\medskip

\date{\today} % Date

\begin{document}
\tikzstyle{every picture}+=[remember picture]

\everymath{\displaystyle}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}{Outline}
\tableofcontents
\end{frame}

\section{Background}

\begin{frame}{Why}

a integrated statistical

\end{frame}
\bibliographystyle{chicago}
\end{document}

• Please format code as code and not as a quote. Use the {} or ctrl+k. – cfr Sep 19 '17 at 3:17
• I do this, but based on the tree layouts. I suppose it wouldn't work here. – cfr Sep 19 '17 at 3:18
• \def\name is a really awful idea. Please, don't do this. Some of the packages you are loading make no sense at all with beamer. multicol, indentfirst and probably the caption and figure packages. You don't need to load things like graphicx and table should be passed to xcolor rather than colortbl. textpos doesn't seem the best idea, either, but that's just a hunch and could be fine. – cfr Sep 19 '17 at 3:20

why don't you use the \logo macro. Simply put it in document's preamble.
\logo{\includegraphics{pic}}