Let me try to expand Petya comment in an explicit case, hoping that this can be useful.

Take $K >>0$ and consider the set of functions

$f_k:=e^{-kx^2}, \quad k=1,2, \ldots, K$.

Assume that we want to find an analytic function $f$ satisfying the requirement of the question and which is a linear combination of the $f_k$, namely

$f=\sum_{k=1}^K a_kf_k, \quad a_k \in \mathbb{R}$.

Then we must solve the following system of equations

$\sum_{k=1}^k A_ka_k =\sum_{i,j=1}^K A_{ij} a_ia_j$

$\sum_{k=1}^k B_ka_k =\sum_{i,j=1}^K A_{ij} a_ia_j$

$\sum_{k=1}^k B_ka_k =\sum_{i,j=1}^K B_{ij} a_ia_j$,

where

$A_k:=\int_{\mathbb{R}} f_k, \quad A_{ij}:=\int_{\mathbb{R}} f_i \cdot f_j$,

$B_k:=\sum_{n \in \mathbb{Z}} f_k(n), \quad B_{ij}:=\sum_{n \in \mathbb{Z}} f_i(n) \cdot f_j (n)$.

This system of equations geometrically describes the intersection of three non-empty quadrics hypersurfaces in $\mathbb{R}^K$, so one expects infinite solutions for $K$ big enough.